Part Number Hot Search : 
SN16913P 15000 MSCD204 MBRS240 UPD6308 GBJ206 L65610 TL071
Product Description
Full Text Search
 

To Download TMP92C820FG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 TOSHIBA Original CMOS 16-Bit Microcontroller
TLCS-900/H1 Series
TMP92C820FG
Semiconductor Company
Preface
Thank you very much for making use of Toshiba microcomputer LSIs. Before use this LSI, refer the section, "Points of Note and Restrictions". Especially, take care below cautions.
**CAUTION** How to release the HALT mode Usually, interrupts can release all halts status. However, the interrupts = (INT0 to INT3, INTKEY, INTRTC, INTALM0 to INTALM4), which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, halt status can be released without difficultly. The priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
TMP92C820
CMOS 32-bit Microcontrollers
TMP92C820FG/JTMP92C820 1. Outline and Device Characteristics
TMP92C820 is high-speed advanced 32-bit microcontroller developed for controlling equipment which processes mass data. TMP92C820 is a microcontroller which has a high-performance CPU (900/H1 CPU) and various built-in I/Os. TMP92C820FG is housed in a 144-pin flat package. JTMP92C820 is a 144-pad chip product. Device characteristics are as follows: (1) CPU: 32-bit CPU (900/H1 CPU) * * * * Compatible with TLCS-900, 900/L, 900/L1, 900/H's instruction code 16 Mbytes of linear address space General-purpose register and register banks Micro DMA: 8 channels (250 ns/4 bytes at fSYS = 20 MHz, best case)
(2) Minimum instruction execution time: 50 ns (at SYS = 20 MHz)
RESTRICTIONS ON PRODUCT USE
* The information contained herein is subject to change without notice. 021023_D
070208EBP
* TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the "Handling Guide for Semiconductor Devices," or "TOSHIBA Semiconductor Reliability Handbook" etc. 021023_A * The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury ("Unintended Usage"). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's own risk. 021023_B * The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_Q * The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patents or other rights of TOSHIBA or the third parties. 021023_C * The products described in this document are subject to foreign exchange and foreign trade control laws. 060925_E * For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and Reliability Assurance/Handling Precautions. 030619_S
92C820-1
2007-02-16
TMP92C820
(3) Internal memory * * * * * * Internal RAM: 8 Kbytes (can use for code section) Internal ROM: None Expandable up to 136 Mbytes (Shared with program/data area) Can simultaneously support 8-/16-/32-bit width external data bus .... Dynamic data bus sizing Separate bus system Chip select outputs: 4 channels
(4) External memory expansion
(5) Memory controller (6) 8-bit timers: 4 channels (7) 16-bit timer/event counter: 1 channel (8) General-purpose serial interface: 3 channels * UART/synchronous mode * IrDA (9) Serial bus interface: 1 channel * I2C bus mode * Clock synchronous select mode (10) LCD controller * Shift register/built-in RAM LCD driver * * Supported 16, 8 and 4 gray-levels and black and white Hardware blinking cursor
(11) SDRAM controller * Supported 16-M, 64-M and 128-Mbit SDRAM with 16-/32-bit data bus (12) Timer for real-time clock (RTC) * Based on TC8521A * Separate the power supply (13) Key-on wakeup (Interrupt key input) (14) 10-bit AD converter: 5 channels (15) Watchdog timer (16) Melody/alarm generator * Melody: Output of clock 4 to 5461 Hz * * Alarm: Output of the 8 kinds of alarm pattern Output of the 5 kinds of interval interrupt
(17) MMU * Expandable up to 136 Mbytes (4 local areas/8 bank methods) (18) Interrupts: 45 interrupts * 9 CPU interrupts: Software interrupt instruction and illegal instruction * * 31 internal interrupts: Seven selectable priority levels 5 external interrupts: Seven selectable priority levels (4-edge selectable)
92C820-2
2007-02-16
TMP92C820
(19) Input/output ports: 83 pins (Except Data bus (16bit), Address bus (24bit) and RD pin) (20) Standby function * Three HALT modes: IDLE2 (Programmable), IDLE1, STOP (21) Triple-clock controller * Clock gear function: Select a high-frequency clock fc to fc/16 * RTC (fs = 32.768 kHz) (22) Operating voltage * DVCC = 3.0 to 3.6 V * RTCVCC = 2.0 to 3.6 V (23) Package * 144-pin QFP (P-LQFP144-1616-0.40C) * Chip form supply also available. For details, contact your local Toshiba sales representative
92C820-3
2007-02-16
TMP92C820
PG0 to PG4 (AN0 to AN4) ( ADTRG ) PG3 AVCC AVSS VREFH VREFL (TXD0) PF0 (RXD0) PF1 (SCLK0/ CTS0 ) PF2 (TXD1) PF3 (RXD1) PF4 (SCLK1/ CTS1 ) PF5 ( CS2G /TXD2) P95 ( CSEXA RXD2) P96 (SCK) P90 (SO/SDA) P91 (SI/SCL) P92 ( CS2E ) P93 ( CS2F ) P94
900/H1 CPU 10-bit 5-channel AD converter XWA XBC XDE Serial I/O SIO0 Serial I/O SIO1 Serial I/O SIO2 Serial bus I/F SBI0 Port 9 XHL XIX XIY XIZ XSP 32 bits SR PC F Port 0 Port 1 Port 2 Port 3 Watchdog timer Port 4 Port 5 MMU Port 6 W B D H IX IY IZ SP A C E L Mode controller Interrupt controller
DVCC [3] DVSS [4] H-OSC Clock gear L-OSC XT1 XT2
RESET
X1 X2
AM0 AM1
PC3 (INT0)
D0 to D7 P10 to P17 (D8 to D15) P20 to P27 (D16 to D23) P30 to P37 (D24 to D31) P40 to P47 (A0 to A7) P50 to P57 (A8 to A15) P60 to P67 (A16 to A23) P70 ( RD ) P71 ( WRLL ) P72 ( WRLU ) P73 ( WRUL ) P74 ( WRUU ) P75 (R/ W ) P76 ( WAIT ) P80 ( CS0 / SDCSH ) P81 ( CS1 / SDCSL ) P82 ( CS2 / CS2A ) P83 ( CS3 ) P84 ( CS2B /EA24) P85 ( CS2C /EA25) P86 ( CS2D )
(TA0IN) PC0
8-bit timer (Timer 0) 8-bit timer (Timer 1) 8-bit timer (Timer 2)
(TA1OUT/INT1) PC1
8-Kbyte RAM
Port 7
(TA3OUT/INT2) PC5
8-bit timer (Timer 3) Port 8 16-bit timer
(TB0OUT0/INT3) PC6
(D1BSCP) PK0 (D2BLP) PK1 (D3BFR) PK2 (DLEBCD) PK3 (DOFFB) PK4 PL0 to PL7 (LD0 to LD7) ( SDRAS ) PJ0 ( SDCAS ) PJ1 ( SRWR / SDWE ) PJ2 ( SRLLB /SDLLDOM) PJ3 ( SRLUB /SDLUDOM) PJ4 ( SRULB /SDULDOM) PJ5 ( SRUUB /SDUUDOM) PJ6 (SDCKE) PJ7 (SDCLK) P87
LCD controller
Keyboard I/F RTC Melody/ alarm out
PA0 to PA7 (KI0 to KI7) RTCVCC XT1/XT2/ BE ( ALARM / MLDALM /PK6)
SDRAM controller
Figure 1.1 TMP92C820 Block Diagram
92C820-4
2007-02-16
TMP92C820
2.
Pin Assignment and Functions
The assignment of input/output pins for the TMP92C820, their names and functions are as follows:
2.1
Pin Assignment
Figure 2.1.1 shows the pin assignment of the TMP92C820FG.
0H
140
135
130
125
120
115
VREFL VREFH PG0/AN0 PG1/AN1 PG2/AN2 PG3/AN3/ADTRG PG4/AN4 PA3/KI3 PA4/KI4 PA5/KI5 PA6/KI6 PA7/AI7 PC0/TA0IN PC1/TA1OUT/INT1 PC5/TA3OUT/INT2 PC6/TB0OUT0/INT3 PF0/TXD0 PF1/RXD0 PF2/SCLK0/CTS0 PF3/TXD1 PF4/RXD1 PF5/SCLK1/CTS1 PL0/LD0 PL1/LD1 PL2/LD2 PL3/LD3 PL4/LD4 PL5/LD5 PL6/LD6 PL7/LD7 PK0/D1BSCP PK1/D2BLP PK2/D3BFR PK3/DLEBCD PK4/DOFFB PK6/ALARM/MLDALM
1
110
AVCC AVSS PA2/KI2 PA1/KI1 PA0/KI0 PJ7/SDCKE PJ6/SDUUDQM/SRUUB PJ5/SDULDQM/SRULB PJ4/SDLUDQM/SRLUB PJ3/SDLLDQM/SRLLB PJ2/SDWE/SRWR PJ1/SDCAS PJ0/SDRAS P96/CSEXA/RXD2 P95/CS2G/TXD2 P94/CS2F P93/CS2E P92/SI/SCL P91/SO/SDA P90/SCK P87/SDCLK P86/CS2D P85/EA25/CS2C P84/EA24/CS2B P83/CS3 P82/CS2/CS2A P81/CS1/SDCSL DVSS4 P80/CS0/SDCSH P76/WAIT P75/RW P74/WRUU P73/WRUL P72/WRLU P71/WRLL P70/RD
105 5
100 10
15
TMP92C820FG QFP144
95
90 20
Top view
85
25
80 30
75 35 40 45 50 55 60 65 70
P67/A23 P66/A22 P65/A21 P64/A20 DVCC3 P63/A19 P62/A18 P61/A17 P60/A16 P57/A15 P56/A14 P55/A13 A54/A12 P53/A11 P52/A10 P51/A9 P50/A8 P47/A7 P46/A6 P45/A5 P44/A4 P43/A3 P42/A2 P41/A1 P40/A0 P37/D31 P36/D30 DVSS3 P35/D29 P34/D28 P33/D27 P32/D26 P31/D25 P30/D24 P27/D23 P26/D22
Figure 2.1.1 Pin Assignment Diagram (144-pin QFP)
PC3/INT0 DVSS2 DVCC2 P00/D0 P01/D1 P02/D2 P03/D3 P04/D4 P05/D5 P06/D6 P07/D7 P10/D8 P11/D9 P12/D10 P13/D11 P14/D12 P15/D13 P16/D14 P17/D15 P20/D16 P21/D17 P22/D18 P23/D19 P24/D20 P25/D21
RTCVCC XT1 XT2
DVCC1 X1 DVSS1 X2 AM0 AM1
RESET
BE
92C820-5
2007-02-16
TMP92C820
2.2
PAD Layout
Table 2.2.1 PAD Layout (144-pin chip) Unit: m
Pin No. 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 Name DVSS2 DVCC2 P00 P01 P02 P03 P04 P05 P06 P07 P10 P11 P12 P13 P14 P15 P16 P17 P20 P21 P22 P23 P24 P25 P26 P27 P30 P31 P32 P33 P34 P35 DVSS3 P36 P37 P40 P41 P42 P43 P44 P45 P46 P47 P50 P51 P52 P53 P54 X Point -440 -340 -240 -140 -40 59 160 260 360 460 561 661 761 861 961 1062 1162 1263 1363 1474 1589 1702 1814 1926 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 Y Point -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -1924 -1799 -1674 -1548 -1426 -1311 -1199 -1087 -975 -864 -757 -648 -541 -435 -332 -228 -128 -28 71 171 272 374 477 581 Pin No. 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 Name P55 P56 P57 P60 P61 P62 P63 DVCC3 P64 P65 P66 P67 P70 P71 P72 P73 P74 P75 P76 P80 DVSS4 P81 P82 P83 P84 P85 P86 P87 P90 P91 P92 P93 P94 P95 P96 PJ0 PJ1 PJ2 PJ3 PJ4 PJ5 PJ6 PJ7 PA0 PA1 PA2 AVSS AVCC X Point 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 1925 1800 1675 1558 1448 1346 1243 1141 1038 937 835 734 633 532 431 330 229 128 28 -72 -173 -274 -375 -477 -580 -684 -788 -892 -996 -1101 -1208 -1319 -1430 -1555 -1828 -1955 Y Point 685 789 894 1000 1107 1213 1321 1430 1546 1672 1798 1924 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211 2211
(Chip size 4.68 mm x 4.68 mm)
Pin No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Name VREFL VREFH PG0 PG1 PG2 PG3 PG4 PA3 PA4 PA5 PA6 PA7 PC0 PC1 PC5 PC6 PF0 PF1 PF2 PF3 PF4 PF5 PL0 PL1 PL2 PL3 PL4 PL5 PL6 PL7 PK0 PK1 PK2 PK3 PK4 PK6 RTCVCC XT1 XT2
BE
X Point -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -1962 -1851 -1574 -1466 -1360 -1257 -1057 -957 -840 -740 -640 -540
Y Point 1945 1820 1694 1568 1460 1353 1249 1050 946 842 739 635 531 427 326 224 123 23 -77 -179 -284 -388 -493 -598 -704 -809 -914 -1024 -1132 -1243 -1354 -1464 -1576 -1701 -1826 -1953 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213 -2213
DVCC1 X1 DVSS1 X2 AM0 AM1
RESET
PC3
92C820-6
2007-02-16
TMP92C820
2.3
Pin Names and Functions
The following table shows the names and functions of the input/output pins. Table 2.3.1 Pin Names and Functions (1/3)
Pin Names
D0 to D7 P10 to P17 D8 to D15 P20 to P27 D16 to D23 P30 to P37 D24 to D31 P40 to P47 A0 to A7 P50 to P57 A8 to A15 P60 to P67 A16 to A23 P70
RD
Number of Pins
8 8 8 8 8 8 8 1 1 1 1 1 1 1
I/O
I/O I/O I/O I/O I/O I/O I/O I/O Output I/O Output I/O Output Output Output Output Output Output Output Output Output Output Output Output Output I/O Input Output
Functions
Data: Data bus 0 to 7. Port 1: I/O port. Input or output specifiable in units of bits. Data: Data bus 8 to 15. Port 2: I/O port. Input or output specifiable in units of bits. Data: Data bus 16 to 23. Port 3: I/O port. Input or output specifiable in units of bits. Data: Data bus 24 to 31. Port 4: I/O port. Input or output specifiable in units of bits. Address: Address bus 0 to 7. Port 5: I/O port. Input or output specifiable in units of bits. Address: Address bus 8 to 15. Port 6: I/O port. Input or output specifiable in units of bits. Address: Address bus 16 to 23. Port 70: Output port Read: Outputs strobe signal to read external memory. Port 71: Output port Write: Output strobe signal for writing data on pins D0 to D7. Port 72: Output port Write: Output strobe signal for writing data on pins D8 to D15. Port 73: Output port Write: Output strobe signal for writing data on pins D16 to D23. Port 74: Output port Write: Output strobe signal for writing data on pins D24 to D31. Port 75: Output port Read/Write: 1 represents read or dummy cycle; 0 represents write cycle. Port 76: I/O port Wait: Signal used to request CPU bus wait. Port 80: Output port Chip select 0: Outputs "low" when address is within specified address area. Chip select for SDRAM: Outputs "0" when address is within SDRAM upper-address area. Port 81: Output port Chip select 1: Outputs "low" when address is within specified address area. Chip select for SDRAM: Outputs "0" when address is within SDRAM lower-address area. Port 82: Output port Chip select 2: Outputs "low" when address is within specified address area. Expand chip select 2A: Outputs "0" when address is within specified address area. Port 83: Output port Chip select 3: Outputs "low" when address is within specified address area. Port 84: Output port Chip select 24: Outputs "0" when address is within specified address area. Expand chip select 2B: Outputs "0" when address is within specified address area. Port 85: Output port Chip select 25: Outputs "0" when address is within specified address area. Expand chip select 2C: Outputs "0" when address is within specified address area. Port 86: Output port Expand chip select 2D: Outputs "0" when address is within specified address area. Port 87: Output port Clock for SDRAM
P71
WRLL
P72
WRLU
P73
WRUL
P74
WRUU
P75 R/ W P76
WAIT
P80
CS0
SDCSH
1
Output Output Output
P81
CS1 SDCSL
1
Output Output Output
P82
CS2 CS2A
1
Output Output Output Output Output Output Output Output
P83
CS3
1
P84 EA24
CS2B
1
P85 EA25
CS2C
1
Output Output Output Output Output Output
P86
CS2D
1 1
P87 SDCLK
92C820-7
2007-02-16
TMP92C820
Table 2.3.1 Pin Names and Functions (2/3) Pin Names
P90 SCK P91 SO SDA P92 SI SCL P93
CS2E
Number of Pins
1
I/O
I/O I/O I/O Output I/O I/O Port 90: I/O port
Functions
Serial bus interface clock I/O data at SIO mode. Port 91: I/O port Serial bus interface send data at SIO mode. Serial bus interface send/receive data at I C mode. (Open drain/output mode by programmable.) Port 92: I/O port Serial bus interface receive data at SIO mode. Serial bus interface clock I/O data at I C mode. (Open drain/output mode by programmable.) Port 93: I/O port Expand chip select 2E: Outputs "0" when address is within specified address area. Port 94: I/O port Expand chip select 2F: Outputs "0" when address is within specified address area. Port 95: Output port Expand chip select 2G: Outputs "0" when address is within specified address area. Serial transmission data 2. Open drain/output pin by programmable. Port 96: Output port Serial receive data 2. Expand chip select EXA: Outputs "0" when address is within specified address area. A0 to A7 port: Pin used to input ports. Key input 0 to 7: Pin used of key-on wakeup 0 to 7. (Schmitt input, with pull-up resistor.) Port C0: I/O port 8-bit timer 0 input: Timer 0 input. Port C1: I/O port Interrupt request pin1 : Interrupt request pin with programmable rising /falling edge. 8-bit timer 1 output: Timer 1 output. Port C3: I/O port Interrupt request pin 0: Interrupt request pin with programmable level/rising/falling edge. Port C5: I/O port Interrupt request pin 2 : Interrupt request pin with programmable rising /falling edge. 8-bit timer 3 output: Timer 3 output. Port C6: I/O port Interrupt request pin 3: Interrupt request pin with programmable rising /falling edge. Timer B0 output. Port F0: I/O port Serial 0 send data: Open drain/output pin by programmable. Port F1: I/O port Serial 0 receive data. Port F2: I/O port Serial 0 clock I/O. Serial 0 data send enable (Clear to send). Port F3: I/O port Serial 1 send data: Open drain/output pin by programmable. Port F4: I/O port Serial 1 receive data. Port F5: I/O port Serial 1 clock I/O. Serial 1 data send enable (Clear to send). Port G0 to G4 port: Pin used to input ports. Analog input 0 to 4: Pin used to Input to AD conveter. AD trigger: Signal used to request AD start (with used to PG3).
2 2
1
1
Input I/O I/O Output I/O Output I/O Output Output I/O
1 1
P94
CS2F
P95
CS2G
1
TXD2 P96 RXD2
CSEXA
1
Input Output Input
PA0 to PA7 KI0 to KI7 PC0 TA0IN PC1 INT1 TA1OUT PC3 INT0 PC5 INT2 TA3OUT PC6 INT3 TB0OUT0 PF0 TXD0 PF1 RXD0 PF2 SCLK0
CTS0
8
Input I/O Input I/O Input Output I/O Input I/O Input Output I/O
1
1
1
1
1
Input Output I/O Output I/O Input I/O I/O Input I/O Output I/O Input I/O I/O Input Input
1 1
1
PF3 TXD1 PF4 RXD1 PF5 SCLK1
CTS1
1 1
1
PG0 to PG4 AN0 to AN4
ADTRG
5
Input Input
92C820-8
2007-02-16
TMP92C820
Table 2.3.1 Pin Names and Functions (3/3) Pin Names
PJ0
SDRAS
Number of Pins
1
I/O
Output Output Output Output Output Port J0: Output port
Functions
Row address strobe for SDRAM: Outputs "0" when address is within SDRAM address area. Port J1: Output port Column address strobe for SDRAM: Outputs "0" when address is within SDRAM address area. Port J2: Output port Write enable for SDRAM. Write for SRAM: Strobe signal for writing data . Port J3: Output port Data enable for SDRAM on pins D0 to D7. Data enable for SRAM on pins D0 to D7. Port J4: Output port Data enable for SDRAM on pins D8 to D15. Data enable for SRAM on pins D8 to D15. Port J5: Output port Data enable for SDRAM on pins D16 to D23. Data enable for SRAM on pins D16 to D23. Port J6: Output port Data enable for SDRAM on pins D24 to D32. Data enable for SRAM on pins D24 to D32. Port J7: Output port Clock enable for SDRAM. Port K0: Output port LCD driver output pin. Port K1: Output port LCD driver output pin. Port K2: Output port LCD driver output pin. Port K3: Output port LCD driver output pin. Port K4: Output port LCD driver output pin. Port K6: Output port RTC alarm output pin. Melody/alarm output pin (Inverted). Port L0 to L7: I/O port Data bus for LCD driver. Backup enable. Operation mode: Fix to AM1 = "0", AM0 = "1": 16-bit external bus or 8-/16-/32-bit dynamic sizing. Fix to AM1 = "1", AM0 = "0": 32-bit external bus or 8-/16-/32-bit dynamic sizing. High-frequency oscillator connection pins. Low-frequency oscillator connection pins. Reset: Initializes TMP92C820 (with pull-up resistor). Pin for reference voltage input to AD converter (H). Pin for reference voltage input to AD converter (L). Power supply pin for AD converter. GND pin for AD converter (0 V). Power supply pins (All DVCC pins should be connected with the power supply pin). GND pins (0 V) (All DVSS pins should be connected with GND (0V)). Power supply pin for RTC and low-frequency oscillator.
PJ1
SDCAS
1
PJ2
SDWE SRWR
1
Output Output Output
PJ3 SDLLDQM
SRLLB
1
Output Output Output
PJ4 SDLUDQM
SRLUB
1
Output Output Output
PJ5 SDULDQM
SRULB
1
Output Output Output
PJ6 SDUUDQM
SRUUB
1
Output Output Output Output Output Output Output Output Output Output Output Output Output Output Output Output Output I/O Output Input Input I/O I/O Input Input Input - - - - -
PJ7 SDCKE PK0 D1BSCP PK1 D2BLP PK2 D3BFR PK3 DLEBCD PK4 DOFFB PK6
ALARM
MLDALM
1 1 1 1 1 1
1
PL0 to PL7 LD0 to LD7
BE
8 1 2 2 2 1 1 1 1 1 3 4 1
AM0, AM1 X1/X2 XT1/XT2
RESET
VREFH VREFL AVCC AVSS DVCC DVSS RTCVCC
92C820-9
2007-02-16
TMP92C820
3.
3.1
Operation
This section describes the basic components, functions and operation of the TMP92C820.
CPU
The TMP92C820 contains an advanced high-speed 32-bit CPU (900/H1 CPU). For CPU operation, see the TLCS-900/H1 CPU. The following describe the unique function of the CPU used in the TMP92C820; these functions are not covered in the TLCS-900/H1 CPU section.
3.1.1
CPU Outline
900/H1 CPU is high-speed and high-performance CPU based on 900/L1 CPU. 900/H1 CPU has expanded 32-bit internal data bus to process instructions more quickly. Outline of 900/H1 CPU are as follows: Table 3.1.1 CPU Outline
900/H1 CPU Width of CPU address bus Width of CPU data bus Internal operating frequency Minimum bus cycle Data bus sizing Internal RAM Internal I/O External device Minimum instruction Execution cycle Conditional jump Instruction queue buffer Instruction set CPU mode Micro DMA 2 clocks (100 ns at 20 MHz) 12 bytes Compatible with TLCS-900, 900/L, 900/H, 900/L1 and 900/H2 (NORMAL, MAX, MIN and LDX instruction is deleted.) Only maximum mode 8 channels 24 bits 32 bits 20 MHz 1-clock access (50 ns at 20 MHz) 8/16/32 bits 32 bits 1-clock access 8-/16-bit 8-/16-bit 8 bits 2-clock access (can insert some waits.) 1 clock (50 ns at 20 MHz) 2-clock access 5 to 6-clock access 900/H1 I/O 900/L1 I/O
92C820-10
2007-02-16
TMP92C820 3.1.2 Reset Operation
When resetting the TMP92C820 microcontroller, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then hold the RESET input low for at least 20 system clocks (16 s at 40 MHz). When the reset has been accepted, the CPU performs the following: * Sets the program counter (PC) as follows in accordance with the reset vector stored at address FFFF00H to FFFF02H: PC<7:0> PC<15:8> * * * Data in location FFFF00H Data in location FFFF01H
PC<23:16> Data in location FFFF02H Sets the stack pointer (XSP) to 00000000H. Sets bits of the status register (SR) to 111 (Thereby setting the interrupt level mask register to level 7). Clears bits of the status register to 00 (Thereby selecting register bank0).
When the reset is released, the CPU starts executing instructions according to the program counter settings. CPU internal registers not mentioned above do not change when the reset is released. When the reset is accepted, the CPU sets internal I/O, ports and other pins as follows. * * Initializes the internal I/O registers as table of "Table of Special Function Registers (SFRs)" in section 5. Sets the port pins, including the pins that also act as internal I/O, to general-purpose input or output port mode.
Internal RESET is released as soon as external reset is released. The operation of memory controller cannot be insured until power supply becomes stable after power-on reset. The external RAM data provided before turning on the TMP92C820 may be spoiled because the control signals are unstable until power supply becomes stable after power on reset.
92C820-11
2007-02-16
TMP92C820
VCC 3.3 V
RESET
10 ms (Min) Osc warm-up time + 20 system clock 0 s (Min)
Figure 3.1.1 Power on Reset Timing Example
3.1.3
Setting of AM0 and AM1
Set AM1 and AM0 pins to "10" to use 32-bit external bus, or set it to "01" to use 16-bit external bus. Table 3.1.2 Operation Mode Setup Table Operation Mode
16-bit external bus or 8-/16-/32-bit dynamic bus sizing 32-bit external bus or 8-/16-/32-bit dynamic bus sizing
Mode Setup Input Pin RESET AM1
0
AM0
1
1
0
92C820-12
2007-02-16
TMP92C820
3.2
Memory Map
Figure 3.2.1 is a memory map of the TMP92C820.
1H
000000H Internal I/O (8 Kbytes) 000100H 001FE0H 002000H Internal RAM (8 Kbytes) 004000H Direct area (n)
64-Kbyte area (nn)
010000H
External memory
F00000H Provisional emulator control area (64 Kbytes) F10000H 16-Mbyte area (R) (-R) (R+) (R + R8/16) (R + d8/16) (nnn) (Note 1)
External memory
FFFF00H FFFFFFH
Vector table (256 bytes)
(Note 2) ( = Internal area)
Note 1: Provisional emulator control area is for emulator, it is mapped F00000H to F10000H address after reset. Note 2: Don't use the last 16-byte area (FFFFF0H to FFFFFFH). This area is reserved. Note 3: On emulator WR signal and RD signal are asserted, when provisional emulator control area is accessed. Be careful to use external memory. Figure 3.2.1 Memory Map
92C820-13
2007-02-16
TMP92C820
3.3
Clock Function and Standby Function
TMP92C820 contains (1) Clock gear, (2) Standby controller, and (3) Noise reduction circuit. It is used for low-power, low-noise systems. This chapter is organized as follows: 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5
2H 3H 4H 5H 6H 7H 8H 9H 10H 1H
Block Diagram of System Clock SFR System Clock Controller Noise Reduction Circuits Standby Controller
92C820-14
2007-02-16
TMP92C820
The clock operating modes are as follows: (a) Single clock mode (X1, X2 pins only) and (b) Dual clock mode (X1, X2, XT1, and XT2 pins). Figure 3.3.1 shows a transition figure.
12H
Reset (fOSCH/32) IDLE2 mode (I/O operate)
Instruction Interrupt Instruction
Release reset
NORMAL mode (fOSCH/gear value/2)
IDLE1 mode Interrupt (Operate only oscillator) (a)
Instruction STOP mode Interrupt (Stops all circuits)
Single clock mode transition figure Reset (fOSCH/32)
IDLE2 mode (I/O operate)
Instruction Interrupt Instruction
Release reset
NORMAL mode
Instruction
IDLE1 mode Interrupt (Operate only oscillator) IDLE2 mode (I/O operate)
(fOSCH/gear value/2) Instruction SLOW mode (fs/2) Interrupt STOP mode (Stops all circuits)
Instruction Interrupt Instruction
IDLE1 mode Interrupt (Operate only oscillator) (b)
Instruction
Dual clock mode transition figure
Figure 3.3.1 System Clock Block Diagram
The clock frequency input from the X1 and X2 pins is called fc and the clock frequency input from the XT1 and XT2 pins is called fs. The clock frequency selected by SYSCR1 is called the system clock fFPH. The system clock fSYS is defined as the divided clock of fFPH, and one cycle of fSYS is defined to as one state.
92C820-15
2007-02-16
TMP92C820 3.3.1 Block Diagram of System Clock
SYSCR0 SYSCR2 Warm-up timer (High-/low-frequency oscillator) fFPH SYSCR0 XT1 XT2
Low-frequency oscillator
T T0
/4 /8
fs fs fc /2 fc/2 fc/4 fc/8
fc/16 /2 /4 /8 /16
fSYS /2 fio
SYSCR0 X1 X2
High-frequency oscillator
SYSCR1
fOSCH
SYSCR1
Clock gear
fSYS fio T0
TMRA0 to TMRA3, TMRB0 Prescaler
CPU RAM Interrupt controller
SIO0 to SIO2 Prescaler
ADC I/O ports
SBI T Prescaler
SDRAMC LCDC
RTC fs MLD/ALM
WDT
Figure 3.3.2 Block Diagram of System Clock
92C820-16
2007-02-16
TMP92C820 3.3.2 SFR
7
SYSCR0 Bit symbol (10E0H) Read/Write After reset Function XEN R/W 1
High-frequency oscillator (fc) 0: Stop 1: Oscillation
6
XTEN 1
Low-frequency oscillator (fs) 0: Stop 1: Oscillation
5
4
3
2
WUEF R/W 0
Warm-up timer 0: Write Don't care 1: Write start timer 0: Read end warm up 1: Read do not end warm up
1
0
SYSCR1 Bit symbol (10E1H) Read/Write After reset Function
SYSCK 0 Select system clock. 0: fc 1: fs
GEAR2 R/W 1
GEAR1 0
GEAR0 0
Select gear value of high frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: 110: Reserved 111: HALTM0 R/W 1 SELDRV 0 mode select 0: STOP 1: IDLE1 DRVE 0 Pin state control in STOP/ IDLE1 mode 0: I/O off 1: Remains the state before halt.
SYSCR2 Bit symbol (10E2H) Read/Write After reset Function
- R/W 0 Always write "0".
WUPTM1 1
WUPTM0 0
HALTM1 1
Warm-up timer 00: Reserved 8 01: 2 /inputted frequency 14 10: 2 /inputted frequency 16 11: 2 /inputted frequency
HALT mode 00: Reserved 01: STOP mode 10: IDLE1 mode 11: IDLE2 mode
Note 1:
The unassigned register, SYSCR0, SYSCR0, SYSCR1, and SYSCR2 are read as undefined value.
Note 2:
By reset, low-frequency oscillator is enabled.
Figure 3.3.3 SFR for System Clock
92C820-17
2007-02-16
TMP92C820
7
EMCCR0 Bit symbol (10E3H) Read/Write After reset Function PROTECT R 0 Protect flag 0: OFF 1: ON
6
5
4
3
2
EXTIN 0
1
DRVOSCH R/W 1
0
DRVOSCL 1 fs oscillator drive ability 1: Normal 0: Weak
1: fc external fc oscillator clock drive ability 1: Normal 0: Weak
EMCCR1 Bit symbol (10E4H) Read/Write EMCCR2 After reset (10E5H) Function
Switching the protect ON/OFF by write to following 1st-key, 2nd-key 1st-Key: EMCCR1 = 5AH, EMCCR2 = A5H in succession write 2nd-Key: EMCCR1 = A5H, EMCCR2 = 5AH in succession write
Figure 3.3.4 SFR for Noise-reduction
Note: In caseWhen restarting the oscillator in from the stop oscillation state (e.g. Restart restarting the oscillator in STOP mode), set EMCCR0, ="1".
92C820-18
2007-02-16
TMP92C820 3.3.3 System Clock Controller
The system clock controller generates the system clock signal (fSYS) for the CPU core and internal I/O. It contains two oscillation circuits and a clock gear circuit for high-frequency (fc) operation. The register SYSCR1 changes the system clock to either fc or fs, SYSCR0 and SYSCR0 control enabling and disabling of each oscillator, and SYSCR1 sets the high-frequency clock gear to either 1, 2, 4, 8, or 16 (fc, fc/2, fc/4, fc/8, or fc/16). These functions can reduce the power consumption of the equipment in which the device is installed. The combination of settings = 1, = 1, = 0 and = 100 will cause the system clock (fSYS) to be set to fc/32 (fc/16 x 1/2) after reset. For example, fSYS is set to 1.25 MHz when the 40 MHz oscillator is connected to the X1 and X2 pins. (1) Switching from NORMAL mode to SLOW mode When the resonator is connected to the X1 and X2 pins, or to the XT1 and XT2 pins, the warm-up timer can be used to change the operation frequency after stable oscillation has been attained. The warm-up time can be selected using SYSCR2. This warm-up timer can be programmed to start and stop as shown in the following examples 1 and 2. Table 3.3.1 shows the warm-up time.
13H
Note 1: When using an oscillator (other than a resonator) with stable oscillation, a warm-up timer is not needed. Note 2: The warm-up timer is operated by an oscillation clock. Hence, there may be some variation in warm-up time.
Table 3.3.1 Warm-up Times Warm-up Time SYSCR2
01 (2 /frequency) 10 (2 /frequency) 11 (2 /frequency)
16 14 8
Change to NORMAL Mode (fc)
6.4 [s] 409.6 [s] 1.638 [ms]
Change to SLOW Mode (fs)
7.8 [ms] 500 [ms] 2000 [ms]
at fOSCH = 40 MHz, fs = 32.768 kHz
92C820-19
2007-02-16
TMP92C820
Example 1: Setting the clock Changing from high frequency (fc) to low frequency (fs).
EQU 10E0H EQU 10E1H EQU 10E2H LD (SYSCR2), 0X11 - - - - B SET 6, (SYSCR0) SET 2, (SYSCR0) WUP: BIT 2, (SYSCR0) JR NZ, WUP SET 3, (SYSCR1) RES 7, (SYSCR0) X: Don't care, -: No change SYSCR0 SYSCR1 SYSCR2
; ; ; ; ; ; ;
Sets warm-up time to 2 /fs. Enables low-frequency oscillation. Clears and starts warm-up timer. Detects stopping of warm-up timer. Changes fSYS from fc to fs. Disables high-frequency oscillation.
16
X1 and X2 pins XT1 and XT2 pins Warm-up timer End of warm-up timer System clock fSYS Clears and starts Enables low frequency warm-up timer Chages fSYS from fc to fs End of warm-up timer Disables high frequency fc fs
Counts up by fSYS Counts up by fs
92C820-20
2007-02-16
TMP92C820
Example 2: Setting the clock Changing from low frequency (fs) to high frequency (fc).
EQU 10E0H EQU 10E1H EQU 10E2H LD (SYSCR2), 0X10 - - - - B SET 7, (SYSCR0) SET 2, (SYSCR0) WUP: BIT 2, (SYSCR0) JR NZ, WUP RES 3, (SYSCR1) RES 6, (SYSCR0) X: Don't care, -: No change SYSCR0 SYSCR1 SYSCR2
; ; ; ; ; ; ;
Sets warm-up time to 2 /fc. Enables high-frequency oscillation. Clears and starts warm-up timer. Detects stopping of warm-up timer. Changes fSYS from fs to fc. Disables low-frequency oscillation.
14
X1 and X2 pins XT1 and XT2 pins Warm-up timer End of warm-up timer System clock fSYS Enables Clears and starts high frequency warm-up timer Chages fSYS from fs to fc End of warm-up timer Disables low frequency fs fc
Counts up by fSYS Counts up by fc
92C820-21
2007-02-16
TMP92C820
(2) Clock gear controller fFPH is set according to the contents of the clock gear select register SYSCR1 to either fc, fc/2, fc/4, fc/8 or fc/16. Using the clock gear to select a lower value of fFPH reduces power consumption. Example 3: Changing to a high-frequency gear
SYSCR1 X: Don't care EQU LD 10E1H (SYSCR1), XXXX0000B ; Changes fSYS to fc/2.
(High-speed clock gear changing) To change the clock gear, write the register value to the SYSCR1 register. It is necessary the warm-up time until changing after writing the register value. There is the possibility that the instruction next to the clock gear changing instruction is executed by the clock gear before changing. To execute the instruction next to the clock gear switching instruction by the clock gear after changing, input the dummy instruction as follows (Instruction to execute the write cycle).
(Example) SYSCR1
EQU LD LD
10E1H (SYSCR1), XXXX0001B ; (DUMMY), 00H ; Instruction to be executed after clock gear has changed
Changes fSYS to fc/4. Dummy instruction
92C820-22
2007-02-16
TMP92C820 3.3.4 Noise Reduction Circuits
Noise reduction circuits are built in, allowing implementation of the following features. (1) Reduced drivability for high-frequency oscillator (2) Reduced drivability for low-frequency oscillator (3) Single drive for high-frequency oscillator (4) Runaway provision with SFR protection register
(1) Reduced drivability for high-frequency oscillator (Purpose) Reduces noise and power for oscillator when a resonator is used. (Block diagram)
fOSCH Enable oscillation (STOP + EMCCR0) EMCCR0
X1 pin C1
Resonator
C2 X2 pin
(Setting method) The drivability of the oscillator is reduced by writing "0" to EMCCR0 register. By reset, is initialized to "1" and the oscillator starts oscillation by normal drive ability when the power supply is on. Note: This function (EMCCR0 = "0") is available to use in case ofwhen fOSCH = 6 to 10 MHz condition.
92C820-23
2007-02-16
TMP92C820
(2) Reduced drivability for low-frequency oscillator (Purpose) Reduces noise and power for oscillator when a resonator is used. (Block diagram)
XT1 pin C1 Enable oscillation Resonator
EMCCR0 fs XT2 pin
C2
(Setting method) The drivability of the oscillator is reduced by writing 0 to the EMCCR0 register. By reset, is initialized to "1".
(3) Single drive for high-frequency oscillator (Purpose) Not need twin-drive and protect mistake operation by inputted noise to X2 pin when the external oscillator is used. (Block diagram)
fOSCH X1 pin Enable oscillation (STOP + EMCCR0) EMCCR0
X2 pin
(Setting method) The oscillator is disabled and starts operation as buffer by writing "1" to EMCCR0 register. X2 pin is always outputted "1". By reset, is initialized to "0".
92C820-24
2007-02-16
TMP92C820
(4) Runaway provision with SFR protection register (Purpose) Provision in runaway of program by noise mixing. Write operation to specified SFR is prohibited so that provision program in runaway prevents that it is it in the state which is fetch impossibility by stopping of clock, memory control register (Memory controller, MMU) is changed. And error handling in runaway becomes easy by INTP0 interruption. Specified SFR list 1. Memory controller B0CSL/H, B1CSL/H, B2CSL/H, B3CSL/H, BECSL/H MSAR0, MSAR1, MSAR2, MSAR3, MAMR0, MAMR1, MAMR2, MAMR3, PMEMCR MMU LOCAL 0/1/2/3 Clock gear SYSCR0, SYSCR1, SYSCR2, EMCCR0
2. 3.
(Operation explanation) Execute and release of protection (Write operation to specified SFR) become possible by setting up a double key to EMCCR1 and EMCCR2 register. (Double key) 1st-key: Succession writes in 5AH at EMCCR1 and A5H at EMCCR2 2nd-key: Succession writes in A5H at EMCCR1 and 5AH at EMCCR2 A state of protection can be confirmed by reading EMCCR0. By reset, protection becomes OFF. And INTP0 interruption occurs when write operation to specified SFR was executed with protection on state.
92C820-25
2007-02-16
TMP92C820 3.3.5 Standby Controller
(1) HALT modes When the HALT instruction is executed, the operating mode switches to IDLE2, IDLE1 or STOP mode, depending on the contents of the SYSCR2 register. The subsequent actions performed in each mode are as follows: 1. IDLE2: Only the CPU halts. The internal I/O is available to select operation during IDLE2 mode by setting the following register. Table 3.3.2 shows the registers of setting operation during IDLE2 mode.
14H
Table 3.3.2 SFR Setting Operation during IDLE2 Mode Internal I/O
TMRA01 TMRA23 TMRB0 SIO0 SIO1 AD converter WDT SBI
SFR
TA01RUN TA23RUN TB0RUN SC0MOD1 SC1MOD1 ADMOD1 WDMOD SBI0BR0
2. 3.
IDLE1: Only the oscillator, the RTC (Real time clock) and MLD (Melody-alarm generator) continue to operate. STOP: All internal circuits stop operating.
15H
The operation of each of the different HALT modes is described in Table 3.3.3.
Table 3.3.3 I/O Operation during HALT Modes HALT Modes SYSCR2
CPU I/O ports TMRA, TMRB Block SIO, SBI (Note) AD converter WDT LCDC, SDRAMC interrupt controller RTC, MLD Operate Operate Keep the state when the HALT instruction was executed. Available to select operation block (Note) Stop
IDLE2 11
Stop
16H
IDLE1 10
17H
STOP 01
See Table 3.3.6, Table 3.3.7 and Table 3.3.8
18H
Note:
Prohibited in the synchronous mode of SBI circuit.
92C820-26
2007-02-16
TMP92C820
(2) How to release the HALT mode These halt states can be released by resetting or requesting an interrupt. The halt release sources are determined by the combination between the states of interrupt mask register and the HALT modes. The details for releasing the halt status are shown in Table 3.3.4.
19H
1.
Released by requesting an interrupt
The operating released from the HALT mode depends on the interrupt enabled status. When the interrupt request level set before executing the HALT instruction exceeds the value of interrupt mask register, the interrupt due to the source is processed after releasing the HALT mode, and CPU status executing an instruction that follows the HALT instruction. When the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, releasing the HALT mode is not executed. (In non-maskable interrupts, interrupt processing is processed after releasing the HALT mode regardless of the value of the mask register.) However only for INT0 to INT3, INTKEY, INTRTC, and INTALM0 to INTALM4 interrupts, even if the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, releasing the HALT mode is executed. In this case, interrupt processing, and CPU starts executing the instruction next to the HALT instruction, but the interrupt request flag is held at "1". Note: Usually, interrupts can release all halts status. However, the interrupts (INT0 to INT3, INTKEY, INTRTC, INTALM0 to INTALM4) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, halt status can be released without difficulty. The priority of this interrupt is compared with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
2.
Releasing by resetting
Releasing all halt status is executed by resetting. When the STOP mode is released by RESET, it is necessary enough resetting time (See Table 3.3.5) to set the operation of the oscillator to be stable.
20H
When releasing the HALT mode by resetting, the internal RAM data keeps the state before the "HALT" instruction is executed. However the other settings contents are initialized. (Releasing due to interrupts keeps the state before the "HALT" instruction is executed.)
92C820-27
2007-02-16
TMP92C820
Table 3.3.4 Source of Halt State Clearance and Halt Clearance Operation
Status of Received Interrupt HALT Mode
INTWDT
Source of Halt State Clearance
Interrupt Enabled (Interrupt level) (Interrupt mask) IDLE2
Initialize LSI
Interrupt Disabled (Interrupt level) < (Interrupt mask) IDLE2
-
IDLE1
x x x x x x x
STOP
x *1 x x x x x *1 x x x
IDLE1
-
STOP
-
INT0 to 3 (Note1) INTALM0 to 4 INTTA0 to 3, INTTB00 to 01
Interrupt

x x x x

x x x x
*1
x x x x x
INTRX0 to 2, TX0 to 2 INTSS0 to 2 INTAD INTKEY INTRTC INTSBE0 INTLCD RESET

x x

x x
*1
x x x
: After clearing the HALT mode, CPU starts interrupt processing.
: After clearing the HALT mode, CPU resumes executing starting from instruction following the HALT
instruction. x: It can not be used to release the HALT mode. -: The priority level (Interrupt request level) of non-maskable interrupts is fixed to 7, the highest priority level. There is not this combination type. *1: Releasing the HALT mode is executed after passing the warm-up time. Note 1: When the HALT mode is cleared by an INT0 interrupt of the level mode in the interrupt enabled status, hold level H until starting interrupt processing. If level L is set before holding level L, interrupt processing is correctly started.
(Example releasing IDLE1 mode) An INT0 interrupt clears the halt state when the device is in IDLE1 mode.
Address 8200H 8203H 8206H 8209H 820BH 820EH INT0
LD LD LD EI LD HALT
(PCFC), 04H (IIMC), 00H (INTE0AD), 06H 5 (SYSCR2), 28H
; ; ; ; ; ;
Sets PC3F to INT0. Selects INT0 interrupt rising edge. Sets INT0 interrupt level to 6. Sets interrupt level to 5 for CPU. Sets HALT mode to IDLE1 mode. Halts CPU. INT0 interrupt routine RETI
820FH
LD
XX, XX
92C820-28
2007-02-16
TMP92C820
(3) Operation 1. IDLE2 mode In IDLE2 mode only specific internal I/O operations, as designated by the IDLE2 setting register, can take place. Instruction execution by the CPU stops. Figure 3.3.5 illustrates an example of the timing for clearance of the IDLE2 mode halt state by an interrupt.
21H
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt IDLE2 mode
Figure 3.3.5 Timing Chart for IDLE2 Mode Halt State Cleared by Interrupt 2. IDLE1 mode In IDLE1 mode, only the internal oscillator and the RTC and MLD continue to operate. The system clock in the MCU stops. The pin status in the IDLE1 mode is depended on setting the register SYSCR2. Table 3.3.6 , Table 3.3.7 and Table 3.3.8 summarizes the state of these pins in the IDLE1 mode.
2H 0H23 24H
In the halt state, the interrupt request is sampled asynchronously with the system clock; however, clearance of the halt state (e.g., restart of operation) is synchronous with it. Figure 3.3.6 illustrates the timing for clearance of the IDLE1 mode halt state by an interrupt.
25H
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt IDLE1 mode
Figure 3.3.6 Timing Chart for IDLE1 Mode Halt State Cleared by Interrupt
92C820-29
2007-02-16
TMP92C820
3. STOP mode When STOP mode is selected, all internal circuits stop, including the internal oscillator pin status in STOP mode depends on the settings in the SYSCR2 register. Table 3.3.6, Table 3.3.7 and Table 3.3.8 summarizes the state of these pins in STOP mode.
26H 27H 28H
After STOP mode has been cleared system clock output starts when the warm-up time has elapsed, in order to allow oscillation to stabilize. Figure 3.3.7 illustrates the timing for clearance of the STOP mode halt state by an interrupt.
29H
Warm-up time
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt STOP mode
Figure 3.3.7 Timing Chart for STOP Mode Halt State Cleared by Interrupt
Table 3.3.5 Sample Warm-up Times after Clearance of STOP Mode
at fOSCH = 40 MHz, fs = 32.768 kHz
SYSCR0
0 (fc)
SYSCR2 01 (2 )
6.4 s
8
10 (214)
409.6 s
11 (216)
1.638 ms
92C820-30
2007-02-16
TMP92C820
Table 3.3.6 Input Buffer State Table
Input Buffer State Port Name Input Function Name
When the CPU is operating During Reset When used as function pin In HALT mode (IDLE2) When used as Input pin
-
In HALT mode (IDLE1/STOP) Condition A (Note) When used as Function pin When used as Input pin
-
Condition B (Note) When used as Function pin When used as Input pin
-
When used When used as as Function Input pin pin
-
D0-D7 P10-P17 P20-P27
D0-D7 D8-D15 D16-D23
OFF ON upon external read
16-bit start :ON 32-bit start :OFF
ON upon external read of LCDC
OFF
OFF
P30-P37 P40-P47 P50-P57 P60-P67 P76 P90 P91 P92 P93 P94 P95 P96 PA0-PA7 (*1) PC0 PC1 PC3 PC5 PC6 PF0 PF1 PF2 PF3 PF4 PF5 PG0-PG2, PG4 (*2) PG3 (*2) PL0-PL7
BE
D24-D31
- - -
OFF
-
-
OFF
-
-
OFF
OFF
WAIT SCK SDA SI, SCL
- - - -
OFF ON ON OFF OFF
ON
-
-
-
RXD2 KI0-7 TA0IN INT1 INT0 INT2 INT3
- - -
ON ON OFF ON OFF
OFF ON OFF ON OFF ON
OFF ON OFF ON OFF ON
ON
ON
ON
ON
-
-
RXD0 SCLK0, CTS0
-
ON
-
ON
-
ON OFF ON
OFF
-
OFF OFF
-
OFF
RXD1 SCLK1, CTS1
-
ON
-
ON ON upon port read ON
-
OFF
-
OFF
-
OFF
ADTRG
- - - -
ON
-
ON
-
OFF
ON
-
ON
- -
RESET (*1) AM0, AM1 X1, XT1
ON
ON
-
ON
-
ON
ON
-
IDLE1 : ON , STOP : OFF ON: The buffer is always turned on. A current flows the *1: Port having a pull-up/pull-down resistor. input buffer if the input pin is not driven. OFF: The buffer is always turned off. -: No applicable *2: AIN input does not cause a current to flow through the buffer.
Note: Condition A/B are as follows. SYSCR2 register setting HALT mode 0 0 1 1 0 1 0 1 IDLE1 Condition B Condition A Condition B STOP Condition A Condition B
92C820-31
2007-02-16
TMP92C820
Table 3.3.7 Output Buffer State Table (1/2)
Output Buffer State Port Name Output Function Name When the CPU is Operating When used When Used as as Function Output Port Pin
-
In HALT mode (IDLE2) When Used as Function Pin When Used as Output Port
-
During Reset
In HALT mode (IDLE1/STOP) Condition A (Note) Condition B (Note) When Used When Used When Used When Used as as as as Function Output Port Function Pin Output Port Pin
- -
D0-D7 P10-P17 P20-P27 P30-P37 P40-P47 P50-P57 P60-P67 P70 P71 P72 P73 P74 P75 P76 P80
D0-D7 D8-D15 D16-D23 D24-D31 A0-A7 A8-A15 A16-A23 RD WRLL WRLU WRUL WRUU R/W
- -
ON upon OFF external write OFF ON OFF
OFF
ON
ON
ON
ON
OFF
-
-
-
CS0, SDCSH CS1, SDCSL CS2, CS2A CS3 EA24, CS2B EA25, CS2C CS2D SDCLK SCK SO SCL CS2E CS2F CS2G TXD2 CSEXA
- - - - -
P81
P82 P83 P84
ON
ON
ON OFF
ON
P85 P86 P87 P90 P91 P92 P93 P94 P95 P96 PC0 PC1 PC3 PC5 PC6
ON
ON
OFF
ON
OFF
TA1OUT
-
ON
-
ON
-
OFF
-
ON
-
TA3OUT TB0OUT
ON
ON
OFF
ON
92C820-32
2007-02-16
TMP92C820
Table 3.3.8 Output Buffer State Table (2/2)
Output Buffer State When the CPU is Operating During Reset When used as Function Pin PF0 PF1 PF2 PF3 PF4 PF5 PJ0 PJ1 PJ2 TXD0
-
Port Name
Output Function Name
In HALT mode (IDLE2) When Used as Function Pin ON
-
In HALT mode (IDLE1/STOP) Condition A (Note) Condition B (Note) When Used as Function Pin When Used as Output Port
When Used as Output Port
When Used as Output Port
When Used as Function Pin OFF
-
When Used as Output Port
ON
-
-
SCLK0 TXD1
-
ON
-
ON
-
OFF
-
ON
-
SCLK1 SDRAS SDCAS SDWE SRWR SDLLDQM SRLLB SDLUDQM SRLUB SDULDQM SRULB SDUUDQM SRUUB SDCKE D1BSCP D2BLP D3BFR DLEBCD DOFFB ALARM MLDALM LD0-LD7
- -
PJ3
OFF
PJ4
OFF
ON
ON
OFF
ON
PJ5
PJ6
ON ON ON ON in self refresh cycle
PJ7 PK0 PK1 PK2 PK3 PK4 PK6 PL0-PL7 X2 XT2
OFF
ON
-
-
IDLE1: ON, STOP: output "H" level IDLE1: ON, STOP: High-Z
ON: The buffer is always turned on. When the bus is released, however, output buffers for some pins are turned off. OFF: The buffer is always turned off. -: No applicable
*1: Port having a pull-up/pull-down resistor.
Note: Condition A/B are as follos.
SYSCR2 register setting 0 0 0 1 1 0 1 1
HALT mode IDLE1 STOP Condition B Condition A Condition A Condition B Condition B
92C820-33
2007-02-16
TMP92C820
3.4
Interrupts
Interrupts are controlled by the CPU interrupt mask register (Bits 12 to 14 of the status register) and by the built-in interrupt controller. The TMP92C820 has a total of 45 interrupts divided into the following five types: Interrupts generated by CPU: 9 sources * Software interrupts: 8 sources * Illegal Instruction interrupt: 1 source Internal interrupts: 31 sources * Internal I/O interrupts: 23 sources * Micro DMA transfer end interrupts: 8 sources External interrupts: 5 sources * Interrupts on external pins (INT0 to INT3, INTKEY) A fixed individual interrupt vector number is assigned to each interrupt source. Any one of six levels of priority can also be assigned to each maskable interrupt. Non-maskable interrupts have a fixed priority level of 7, the highest level. When an interrupt is generated, the interrupt controller sends the priority of that interrupt to the CPU. When more than one interrupt are generated simultaneously, the interrupt controller sends the priority value of the interrupt is with the highest priority to the CPU. (The highest priority level is 7, the level used for non-maskable interrupts.) The CPU compares the interrupt priority level which it receives with the value held in the CPU interrupt mask register . If the priority level of the interrupt is greater than or equal to the value in the interrupt mask register, the CPU accepts the interrupt. However, software interrupts and illegal instruction interrupts generated by the CPU are processed irrespective of the value in . The value in the interrupt mask register can be changed using the EI instruction (EI num sets to num). For example, the command EI3 enables the acceptance of all non-maskable interrupts and of maskable interrupts whose priority level, as set in the interrupt controller, is 3 or higher. The commands EI and EI0 enable the acceptance of all non-maskable interrupts and of maskable interrupts with a priority level of 1 or above (hence both are equivalent to the command EI1). The DI instruction (Sets to 7) is exactly equivalent to the EI7 instruction. The DI instruction is used to disable all maskable interrupts (since the priority level for maskable interrupts ranges from 1 to 6). The EI instruction takes effect as soon as it is executed. In addition to the general-purpose interrupt processing mode described above, there is also a micro DMA processing mode. In micro DMA mode the CPU automatically transfers data in one-byte, two-byte or four-byte blocks; this mode allows high-speed data transfer to and from internal and external memory and internal I/O ports. In addition, the TMP92C820 also has a software start function in which micro DMA processing is requested in software rather than by an interrupt. Figure 3.4.1 is a flowchart showing overall interrupts processing.
0H
92C820-34
2007-02-16
TMP92C820
Interrupt processing Micro DMA soft start request Interrupt specified by micro DMA start vector? No Yes
Clear interrupt request flag
Interrupt vector value "V" read Interrupt request F/F clear General-purpose interrupt processing
Data transfer by micro DMA
PUSH PC PUSH SR SR Level of accepted interrupt + 1 INTNEST INTNEST + 1
Count Count - 1 Micro DMA processing
Count = 0
Yes
Clear vector register generating micro DMA transfer end interrupt (INTTC0 to INTTC7)
PC (FFFF00H + V)
No
Interrupt processing program
RETI instruction POP SR POP PC INTNEST INTNEST - 1
End
Figure 3.4.1 Interrupt and Micro DMA Processing Sequence
92C820-35
2007-02-16
TMP92C820 3.4.1 General-purpose Interrupt Processing
When the CPU accepts an interrupt, it usually performs the following sequence of operations. However, in the case of software interrupts and illegal instruction interrupts generated by the CPU, the CPU skips steps (1) and (3), and executes only steps (2), (4), and (5). (1) The CPU reads the interrupt vector from the interrupt controller. When more than one interrupt with the same priority level has been generated simultaneously, the interrupt controller generates an interrupt vector in accordance with the default priority and clears the interrupt requests. (The default priority is determined as follows: The smaller the vector value, the higher the priority.) (2) The CPU pushes the program counter (PC) and status register (SR) onto the top of the stack (Pointed to by XSP). (3) The CPU sets the value of the CPU's interrupt mask register to the priority level for the accepted interrupt plus 1. However, if the priority level for the accepted interrupt is 7, the register's value is set to 7. (4) The CPU increments the interrupt nesting counter INTNEST by 1. (5) The CPU jumps to the address given by adding the contents of address FFFF00H + the interrupt vector, then starts the interrupt processing routine. On completion of interrupt processing, the RETI instruction is used to return control to the main routine. RETI restores the contents of the program counter and the status register from the stack and decrements the interrupt nesting counter INTNEST by 1. Non-maskable interrupts cannot be disabled by a user program. Maskable interrupts, however, can be enabled or disabled by a user program. A program can set the priority level for each interrupt source. (A priority level setting of 0 or 7 will disable an interrupt request.) If an interrupt request is received for an interrupt with a priority level equal to or greater than the value set in the CPU interrupt mask register , the CPU will accept the interrupt. The CPU interrupt mask register is then set to the value of the priority level for the accepted interrupt plus 1. If during interrupt processing, an interrupt is generated with a higher priority than the interrupt currently being processed, or if, during the processing of a non-maskable interrupt processing, a non-maskable interrupt request is generated from another source, the CPU will suspend the routine which it is currently executing and accept the new interrupt. When processing of the new interrupt has been completed, the CPU will resume processing of the suspended interrupt. If the CPU receives another interrupt request while performing processing steps (1) to (5), the new interrupt will be sampled immediately after execution of the first instruction of its interrupt processing routine. Specifying DI as the start instruction disables nesting of maskable interrupts. A reset, initializes the interrupt mask register to 111, disabling all maskable interrupts. Table 3.4.1 shows the TMP92C820 interrupt vectors and micro DMA start vectors. FFFF00H to FFFFFFH (256 bytes) is designated as the interrupt vector area.
1H
92C820-36
2007-02-16
TMP92C820
Table 3.4.1 TMP92C820 Interrupt Vectors and Micro DMA Start Vectors (1/2)
Default Priority 1 2 3 4 5 6 7 8 9 10 - 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 Maskable Non maskable
Type
Interrupt Source and Source of Micro DMA Request
Reset or [SWI0] instruction [SWI1] instruction Illegal instruction or [SWI2] instruction [SWI3] instruction [SWI4] instruction [SWI5] instruction [SWI6] instruction [SWI7] instruction (Reserved) INTWD: Watchdog timer Micro DMA INT0: INT0 pin input INT1: INT1 pin input INT2: INT2 pin input INT3: INT3 pin input (Reserved) INTALM0: ALM0 (8 kHz) INTALM1: ALM1 (512 Hz) INTALM2: ALM2 (64 Hz) INTALM3: ALM3 (2 Hz) INTALM4: ALM4 (1 Hz) INTP0: Protect 0 (WR to SFR) (Reserved) INTTA0: 8-bit timer 0 INTTA1: 8-bit timer 1 INTTA2: 8-bit timer 2 INTTA3: 8-bit timer 3 INTTB0: 16-bit timer 0 INTTB1: 16-bit timer 0 INTKEY: Key wakeup INTRTC: RTC (Alarm interrupt) INTTBO0: 16-bit timer 0 (Overflow) INTLCD: LCDC/LP pin INTRX0: Serial receive (Channel 0) INTTX0: Serial transmission (Channel 0) INTRX1: Serial receive (Channel 1) INTTX1: Serial transmission (Channel 1) INTRX2: Serial receive (Channel 2) INTTX2: Serial transmission (Channel 2) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) INTSBE0: SBI I C bus transfer end (Channel 0) (Reserved) (Reserved)
2
Vector Value
0000H 0004H 0008H 000CH 0010H 0014H 0018H 001CH 0020H 0024H - 0028H 002CH 0030H 0034H 0038H 003CH 0040H 0044H 0048H 004CH 0050H 0054H 0058H 005CH 0060H 0064H 0068H 006CH 0070H 0074H 0078H 007CH 0080H 0084H 0088H 008CH 0090H 0094H 0098H 009CH 00A0H 00A4H 00A8H 00ACH 00B0H 00B4H 00B8H 00BCH 00C0H 00C4H
Address Refer to Vector FFFF00H FFFF04H FFFF08H FFFF0CH FFFF10H FFFF14H FFFF18H FFFF1CH FFFF20H FFFF24H - FFFF28H FFFF2CH FFFF30H FFFF34H FFFF38H FFFF3CH FFFF40H FFFF44H FFFF48H FFFF4CH FFFF50H FFFF54H FFFF58H FFFF5CH FFFF60H FFFF64H FFFF68H FFFF6CH FFFF70H FFFF74H FFFF78H FFFF7CH FFFF80H FFFF84H FFFF88H FFFF8CH FFFF90H FFFF94H FFFF98H FFFF9CH FFFFA0H FFFFA4H FFFFA8H FFFFACH FFFFB0H FFFFB4H FFFFB8H FFFFBCH FFFFC0H FFFFC4H
Micro DMA Start Vector
- (Note 1) 0AH (Note 2) 0BH 0CH 0DH 0EH 0FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH 20H (Note 2) 21H 22H (Note 2) 23H 24H (Note 2) 25H 26H 27H 28H 29H 2AH 2BH 2CH 2DH 2EH 2FH 30H 31H
92C820-37
2007-02-16
TMP92C820
Table 3.4.1 TMP92C820 Interrupt Vectors and Micro DMA Start Vectors (2/2)
Default Priority 51 52 53 54 55 56 57 58 59 60 - to - (Reserved) Maskable
Type
Interrupt Source and Source of Micro DMA Request
(Reserved) INTAD: AD conversion end INTTC0: Micro DMA end (Channel 0) INTTC1: Micro DMA end (Channel 1) INTTC2: Micro DMA end (Channel 2) INTTC3: Micro DMA end (Channel 3) INTTC4: Micro DMA end (Channel 4) INTTC5: Micro DMA end (Channel 5) INTTC6: Micro DMA end (Channel 6) INTTC7: Micro DMA end (Channel 7)
Vector Value
00C8H 00CCH 00D0H 00D4H 00D8H 00DCH 00E0H 00E4H 00E8H 00ECH 00F0H : 00FCH
Address Refer to Vector FFFFC8H FFFFCCH FFFFD0H FFFFD4H FFFFD8H FFFFDCH FFFFE0H FFFFE4H FFFFE8H FFFFECH FFFFF0H : FFFFFCH
Micro DMA Start Vector 32H 33H 34H 35H 36H 37H 38H 39H 3AH 3BH - -
Note 1: Micro DMA default priority. Micro DMA initiation takes priority over other maskable interrupt. Note 2: When initiating micro DMA, set at edge detect mode.
92C820-38
2007-02-16
TMP92C820 3.4.2 Micro DMA processing
In addition to general-purpose interrupt processing, the TMP92C820 also includes a micro DMA function. Micro DMA processing for interrupt requests set by micro DMA is performed at the highest priority level for maskable interrupts (Level 6), regardless of the priority level of the interrupt source. Because the micro DMA function is implemented though the CPU, when the CPU is placed in a state of standby by HALT instruction, the requirements of the micro DMA will be ignored (Pending). Micro DMA supports 8 channels and can be transferred continuously by specifying the micro DMA burst function as below. (1) Micro DMA operation When an interrupt request is generated by an interrupt source specified by the micro DMA start vector register, the micro DMA triggers a micro DMA request to the CPU at interrupt priority level 6 and starts processing the request. The eight micro DMA channels allow micro DMA processing to be set for up to 8 types of interrupt at once. When micro DMA is accepted, the interrupt request flip-flop assigned to that channel is cleared. Data in one-byte, two-byte or four-byte blocks, is automatically transferred at once from the transfer source address to the transfer destination address set in the control register, and the transfer counter is decremented by 1. If the value of the counter after it has been decremented is not 0, DMA processing ends with no change in the value of the micro DMA start vector register. If the value of the decremented counter is 0, a micro DMA transfer end interrupt (INTTC0 to INTTC7) is sent from the CPU to the interrupt controller. In addition, the micro DMA start vector register is cleared to 0, the next micro DMA operation is disabled and micro DMA processing terminates. If micro DMA requests are set simultaneously for more than one channel, priority is not based on the interrupt priority level but on the channel number: The lower the channel number, the higher the priority (Channel 0 thus has the highest priority and channel 7 the lowest). If an interrupt request is triggered for the interrupt source in use during the interval between the time at which the micro DMA start vector is cleared and the next setting, general-purpose interrupt processing is performed at the interrupt level set. Therefore, if the interrupt is only being used to initiate micro DMA (and not as a general-purpose interrupt), the interrupt level should first be set to 0 (j.e, interrupt requests should be disabled). If micro DMA and general-purpose interrupts are being used together as described above, the level of the interrupt which is being used to initiate micro DMA processing should first be set to a lower value than all the other interrupt levels. (Note) In this case, edge-triggered interrupts are the only kinds of general interrupts which can be accepted.
Note: If the priority level of micro DMA is set higher than that of other interrupts, CPU operates as follows. In case INTxxx interrupt is generated first and then INTyyy interrupt is generated between checking "Interrupt specified by micro DMA start vector" (in the Figure 3.4.1) and reading interrupt vector with setting below. The vector shifts to that of INTyyy at the time. This is because the priority level of INTyyy is higher than that of INTxxx. In the interrupt routine, CPU reads the vector of INTyyy because cheking of micro DMA has finished. And INTyyy is generated regardless of transfer counter of micro DMA. INTxxx: level 1 without micro DMA INTyyy: level 6 with micro DMA
2H
92C820-39
2007-02-16
TMP92C820
Although the control registers used for setting the transfer source and transfer destination addresses are 32 bits wide, this type of register can only output 24-bit addresses. Accordingly, micro DMA can only access 16 Mbytes (The upper 8 bits of a 32-bit address are not valid). Three micro DMA transfer modes are supported: One-byte transfer, two-byte (One word) transfers and four-byte transfers. After a transfer in any mode, the transfer source and transfer destination addresses will either be incremented or decremented, or will remain unchanged. This simplifies the transfer of data from I/O to memory, from memory to I/O, and from I/O to I/O. For details of the various transfer modes, see section 3.4.2 (4) "Detailed description of the transfer mode register". Since a transfer counter is a 16-bit counter, up to 65536 micro DMA processing operations can be performed per interrupt source (Provided that the transfer counter for the source is initially set to 0000H). Micro DMA processing can be initiated by any one of 34 different interrupts - the 33 interrupts shown in the micro DMA start vectors in Table 3.4.1 and a micro DMA soft start. Figure 3.4.2 shows a 2-byte transfer carried out using a micro DMA cycle in transfer destination address INC mode (Micro DMA transfers are the same in every mode except counter mode). (The conditions for this cycle are as follows: external 8-bit bus, 0 waits, and even-numbered transfer source and transfer destination addresses).
3H 4H
One state 1 CLK 2 3 4 5
A0 to A23
src
dst
Note:
In fact, src and dst address are not output to A23 to A0 pins because they are internal RAM address
States 1 and 2: Instruction fetch cycle (Prefetches the next instruction code) If the instruction queue buffer is FULL, this cycle becomes a dummy cycle. State 3: Micro DMA read cycle. State 4: Micro DMA write cycle. State 5: (The same as in state 1, 2.) Figure 3.4.2 Timing for Micro DMA Cycle
92C820-40
2007-02-16
TMP92C820
(2) Soft start function The TMP92C820 can initiate micro DMA either with an interrupt or by using the micro DMA soft start function, in which micro DMA is initiated by a Write cycle which writes to the register DMAR. Writing 1 to any bit of the register DMAR causes micro DMA to be performed once. (If write "0" to each bit, micro DMA doesn't operate). On completion of the transfer, the bits of DMAR which support the end channel are automatically cleared to 0. Only one channel can be set for DMA request at once. (Do not write "1" to plural bits.) When writing again 1 to the DMAR register, check whether the bit is "0" before writing "1". If read "1", micro DMA transfer isn't started yet. When a burst is specified by the DMAB register, data is transferred continuously from the initiation of micro DMA until the value in the micro DMA transfer counter is 0. If execatee soft start during micro DMA transfer by interrupt source, micro DMA transfer counter doesn't change. Don't use Read-modify-write instruction to avoid writign to other bits by mistake. Symbol Name
DMA request
Address
109H (Prohibit RMW)
7
DREQ7 0
6
DREQ6 0
5
DREQ5 0
4
DREQ4 0 R/W
3
DREQ3 0
2
DREQ2 0
1
DREQ1 0
0
DREQ0 0
DMAR
1: DMA request in software
(3) Transfer control registers The transfer source address and the transfer destination address are set in the following registers. An instruction of the form LDC cr,r can be used to set these registers.
Channel 0 DMAS0 DMAD0 DMAC0 DMAM0 DMA source address register 0: Using only lower 24 bits. DMA destination address register 0: Using only lower 24 bits. DMA counter register 0: 1 to 65536. DMA mode register 0.
Channel 7 DMAS7 DMAD7 DMAC7 DMAM7 DMA source address register 7. DMA destination address register 7. DMA counter register 7. DMA mode register 7.
8 bits 16 bits 32 bits
92C820-41
2007-02-16
TMP92C820
(4) Detailed description of the transfer mode register
0 0 0 Mode DMAM0 to DMAM7
DMAM [4:0]
000ZZ
Mode Description
Destination INC mode (DMADn+) (DMASn) DMACn DMACn - 1 if DMACn = 0 then INTTCn Destination DEC mode (DMADn-) (DMASn) DMACn DMACn - 1 if DMACn = 0 then INTTCn Source INC mode (DMADn) (DMASn+) DMACn DMACn - 1 if DMACn = 0 then INTTCn Source DEC mode (DMADn) (DMASn-) DMACn DMACn - 1 if DMACn = 0 then INTTCn
Execution Time
5 states
001ZZ
5 states
010ZZ
5 states
011ZZ
5 states
100ZZ
Source and destination INC mode (DMADn+) (DMASn+) DMACn DMACn - 1 If DMACn = 0 then INTTCn Source and destination DEC mode (DMADn-) (DMASn-) DMACn DMACn - 1 If DMACn = 0 then INTTCn Destination and fixed mode (DMADn) (DMASn) DMACn DMACn - 1 If DMACn = 0 then INTTCn Counter mode DMASn DMASn + 1 DMACn DMACn - 1 if DMACn = 0 then INTTCn
6 states
101ZZ
6 states
110ZZ
5 states
11100
5 states
ZZ: 00 = 1-byte transfer 01 = 2-byte transfer 10 = 4-byte transfer 11 = Reserved Note 1: The execution time is measured at 1 states = 50 ns (Operation at internal 20 MHz). Note 2: n stands for the micro DMA channel number (0 to 7). DMADn+/DMASn+: Post increment (Register value is incremented after transfer). DMADn-/DMASn-: Post decrement (Register value is decremented after transfer). "I/O" signifies fixed memory addresses; "memory" signifies incremented or decremented memory addresses. Note2: The transfer mode register should not be set to any value other than those listed above.
92C820-42
2007-02-16
TMP92C820 3.4.3 Interrupt Controller Operation
The block diagram in Figure 3.4.3 shows the interrupt circuits. The left-hand side of the diagram shows the interrupt controller circuit. The right-hand side shows the CPU interrupt request signal circuit and the halt release circuit. For each of the 52 interrupt channels there is an interrupt request flag (consisting of a flip-flop), an interrupt priority setting register and a micro DMA start vector register. The interrupt request flag latches interrupt requests from the peripherals. The flag is cleared to zero in the following cases: when a reset occurs, when the CPU reads the channel vector of an interrupt it has received, when the CPU receives a micro DMA request (when micro DMA is set), when a micro DMA burst transfer is terminated, and when an instruction that clears the interrupt for that channel is executed (by writing a micro DMA start vector to the INTCLR register).
5H
An interrupt priority can be set independently for each interrupt source by writing the priority to the interrupt priority setting register (e.g., INTE0AD or INTE12). Six interrupt priorities levels (1 to 6) are provided. Setting an interrupt source's priority level to 0 (or 7) disables interrupt requests from that source. The priority of non-maskable interrupt (Watchdog timer interrupts) is fixed at 7. If more than one interrupt request with a given priority level are generated simultaneously, the default priority (The interrupt with the lowest priority or, in other words, the interrupt with the lowest vector value) is used to determine which interrupt request is accepted first. The 3rd and 7th bits of the interrupt priority setting register indicate the state of the interrupt request flag and thus whether an interrupt request for a given channel has occurred. If several interrupts are generated simultaneously, the interrupt controller sends the interrupt request for the interrupt with the highest priority and the interrupt's vector address to the CPU. The CPU compares the mask value set in of the status register (SR) with the priority level of the requested interrupt; if the latter is higher, the interrupt is accepted. Then the CPU sets SR to the priority level of the accepted interrupt + 1. Hence, during processing of the accepted interrupt, new interrupt requests with a priority value equal to or higher than the value set in SR (e.g., interrupts with a priority higher than the interrupt being processed) will be accepted. When interrupt processing has been completed (e.g., after execution of a RETI instruction), the CPU restores to SR the priority value which was saved on the stack before the interrupt was generated. The interrupt controller also includes eight registers which are used to store the micro DMA start vector. Writing the start vector of the interrupt source for the micro DMA processing (See Table 3.4.1 and Table 3.4.), enables the corresponding interrupt to be processed by micro DMA processing. The values must be set in the micro DMA parameter registers (e.g., DMAS and DMAD) prior to micro DMA processing.
6H 7H
92C820-43
2007-02-16
Interrupt controller Interrupt request F/F S Q 1 Interrupt request signal to CPU RESET Priority encoder 1 3 INTRQ2 to 0 3 3
if INTRQ2 to 0 IFF 2 to 0 then 1.
CPU
(Reserved) R IFF2:0 EI1 to 7 DI Interrupt level detect Interrupt mask F/F
RESET interrupt vector read
INTWD
Priority setting register 7 6 D Q CLR Interrupt request F/F S Q Dn + 3 D0 D1 36 D2 D3 Interrupt vector generator D4 D5 D6 R 1 2 Highest priority A 3 interrupt B 4 level selectC 5 6 7
Dn Dn + 1 Dn + 2
V = 20H V = 24H Decoder Y1 A Y2 Y3 B Y4 Y5 C Y6 6
Interrupt request signal
INT0
Reset
INT1 INT2 INT3 INTALM0 INTALM1 INTALM2 INTALM3 INTALM4 INTTA0
Interrupt request F/F Interrupt vector read Micro DMA acknowledge V = 28H V = 2CH V = 30H V = 34H V = 3CH V = 40H V = 44H V = 48H V = 4CH V = 58H
During IDLE1 During STOP
Figure 3.4.3 Block Diagram of Interrupt Controller
D7 V = D0H V = D4H V = D8H V = DCH V = E0H V = E4H V = E8H V = ECH Soft start 34 D 6 CLR INTTC0 DMA0V DMA1V DMA2V DMA3V Q S Selector 2 4 Interrupt vector read 4-input OR 0 A 1 2 B 3 Micro DMA channel priority encoder
92C820-44
Halt release RESET
INT0, 1, 2, 3, INTKEY, INTRTC, INTALM
Micro DMA counter 0 interrupt
INTTC0 INTTC1 INTTC2 INTTC3 INTTC4 INTTC5 INTTC6 INTTC7
Micro DMA start vector setting register
if IFF = 7 then 0 Micro DMA request
D5 D4 D3 D2 D1 D0
2
Micro DMA channel specification
TMP92C820
2007-02-16
RESET
TMP92C820
(1) Interrupt priority setting registers Symbol Name
INT0& INTAD enable
Address
7
IADC R 0
6
INTAD IADM2 0 INT2 I2M2 0 - -
5
IADM1 R/W 0 I2M1 R/W 0 - -
4
IADM0 0 I2M0 0 -
3
I0C R 0 I1C R 0 I3C R 0
2
INT0 I0M2 0 INT1 I1M2 0 INT3 I3M2 0 ITA0M2 0 ITA2M2 0 ITB0M2 0 INTTBO0 ITBO0M2 0 INTRX0 IRX0M2 0 INTRX1 IRX1M2 0 INTSBE0 ISBE0M2 0 INTALM0 IA0M2 0 INTALM2 IA2M2 0
1
I0M1 R/W 0 I1M1 R/W 0 I3M1 R/W 0 ITA0M1 R/W 0 ITA2M1 R/W 0 ITB0M1 R/W 0 ITBO0M1 R/W 0 IRX0M1 R/W 0 IRX1M1 R/W 0 ISBE0M1 R/W 0 IA0M1 R/W 0 IA2M1 R/W 0
0
I0M0 0 I1M0 0 I3M0 0 ITA0M0 0 ITA2M0 0 ITB0M0 0 ITBO0M0 0 IRX0M0 0 IRX1M0 0 ISBE0M0 0 IA0M0 0 IA2M0 0
INTE0AD
F0H
INTE12
INT1&INT2 enable
D0H
I2C R 0
INTE3
INT3 enable
D1H
- -
Always write "0". INTTA1 (TMRA1) INTTA0& INTETA01 INTTA1 enable D4H ITA1C R 0 INTTA2& INTETA23 INTTA3 enable ITA3C R 0 INTTB0& INTETB01 INTTB1 enable ITB1C R 0 INTTBO0 (Overflow) enable - R 0 INTRX0& INTTX0 enable ITX0C R 0 INTRX1& INTTX1 enable ITX1C R 0 INTSBE0 enable - - INTALM1 INTALM0&
INTEALM 01 INTALM1
INTTA0 (TMRA0) ITA1M0 0 ITA3M0 0 ITB1M0 0 - 0 ITX0M0 0 ITX1M0 0 - ITA0C R 0 ITA2C R 0 ITB0C R 0 ITBO0C R 0 IRX0C R 0 IRX1C R 0 ISBE0C R 0 IA1M0 0 IA3M0 0 IA0C R 0 IA2C R 0
ITA1M2 0 ITA3M2 0 ITB1M2 0 - - 0
ITA1M1 R/W 0 ITA3M1 R/W 0 ITB1M1 R/W 0 - R/W 0
INTAT3 (TMRA3) D5H
INTAT2 (TMRA2)
INTTB1 (TMRB1) D8H
INTTB0 (TMRB0)
INTETBO0
DAH
INTTX0 INTES0 DBH ITX0M2 0 INTTX1 INTES1 DCH ITX1M2 0 - INTESB0 E3H - - - Always write "0". IA1C R 0 INTALM2&
INTEALM 23 INTALM3
ITX0M1 R/W 0 ITX1M1 R/W 0
E5H
IA1M2 0
IA1M1 R/W 0
enable
INTALM3 E6H IA3C R 0 0 IA3M2 IA3M1 R/W 0
enable
92C820-45
2007-02-16
TMP92C820
Symbol
Name
Address
7
- -
6
- -
5
- -
4
-
3
IA4C R 0
2
INTALM4 IA4M2 0 INTRTC IRM2 0 INTKEY IKM2 0 INTLCD ILCDM2 0 INTRX2 IRX2M2 0 INTP0 IP0M2 0
1
IA4M1 R/W 0 IRM1 R/W 0 IKM1 R/W 0 ILCDM1 R/W 0 IRX2M1 R/W 0 IP0M1 R/W 0
0
IA4M0 0 IRM0 0 IKM0 0 ILCDM0 0 IRX2M0 0 IP0M0 0
INTALM4 INTEALM4 enable
E7H
Always write "0". - INTRTC INTERTC enable E8H - - -
INTECKEY
-
- -
-
IRC R 0
Always write "0". INTKEY enable - - - INTLCD INTLCD enable EAH - - INTTX2 INTES2 INTRX2& INTTX2 enable EDH ITX2C R 0 INTP0 enable - - 0 - INTEP0 EEH - - - Always write "0". Interrupt request flag - ITX2M2 ITX2M1 R/W 0 0 ITX2M0 - - - Always write "0". - - - - Always write "0". -
E9H
IKC R 0 ILCD1C R 0 IRX2C R 0 IP0C R 0
IxxM2
0 0 0 0 1 1 1 1
IxxM1
0 0 1 1 0 0 1 1
IxxM0
0 1 0 1 0 1 0 1
Function (Write)
Disables interrupt requests Sets interrupt priority level to 1 Sets interrupt priority level to 2 Sets interrupt priority level to 3 Sets interrupt priority level to 4 Sets interrupt priority level to 5 Sets interrupt priority level to 6 Disables interrupt requests
92C820-46
2007-02-16
TMP92C820
Symbol
Name
Address
7
ITC1C R 0
6
ITC1M2 0 ITC3M2 0 ITC5M2 0 ITC7M2 0 - -
5
ITC1M1 R/W 0 ITC3M1 R/W 0 ITC5M1 R/W 0 ITC7M1 R/W 0 - -
4
ITC1M0 0 ITC3M0 0 ITC5M0 0 ITC7M0 0 -
3
ITC0C R 0 ITC2C R 0 ITC4C R 0 ITC6C R 0 ITCWD R 0
2
ITC0M2 0 ITC2M2 0 ITC4M2 0 ITC6M2 0 INTWD - -
1
ITC0M1 R/W 0 ITC2M1 R/W 0 ITC4M1 R/W 0 ITC6M1 R/W 0 - - -
0
ITC0M0 0 ITC2M0 0 ITC4M0 0 ITC6M0 0 - -
INTTC1 (DMA1) INTTC0& INTETC01 INTTC1 enable F1H
INTTC0 (DMA0)
INTTC3 (DMA3) INTTC2& INTETC23 INTTC3 enable F2H ITC3C R 0 INTTC4& INTETC45 INTTC5 enable ITC5C R 0 INTTC6& INTETC67 INTTC7 enable ITC7C R 0 - -
INTTC2 (DMA2)
INTTC5 (DMA5) F3H
INTTC4 (DMA4)
INTTC7 (DMA7) F4H
INTTC6 (DMA6)
INTWDT
INTWD
F7H
Always write "0". Interrupt request flag
IxxM2
0 0 0 0 1 1 1 1
IxxM1
0 0 1 1 0 0 1 1
IxxM0
0 1 0 1 0 1 0 1
Function (Write)
Disables interrupt requests Sets interrupt priority level to 1 Sets interrupt priority level to 2 Sets interrupt priority level to 3 Sets interrupt priority level to 4 Sets interrupt priority level to 5 Sets interrupt priority level to 6 Disables interrupt requests
92C820-47
2007-02-16
TMP92C820
(2) External interrupt control Symbol Name Address 7 6 5
I3EDGE W Interrupt IIMC input mode control F6H (Prohibit RMW) 0
0: Rising 1: Falling
4
I2EDGE W 0
0: Rising 1: Falling
3
I1EDGE W 0
0: Rising 1: Falling
2
I0EDGE W 0
0: Rising 1: Falling
1
I0LE R/W 0
0: Edge mode 1: Level mode
0
- R/W 0
Always write "0".
INT3EDGE INT2EDGE INT1EDGE INT0EDGE INT0
*INT0 level enable 0 1 Edge detect INT "H" level INT
Note 1: Disable INT0 request before changing INT0 pin mode from level sense to edge sense. Setting example:
DI LD LD EI (IIMC), XXXXXX0 - B (INTCLR), 0AH ; ; Switches from level to edge. Clears interrupt request flag.
Note 2: X: Don't care, -: No change Note 3: See electrical characteristics in section 4 for external interrupt input pulse width. Settings of External Interrupt Pin Function Interrupt
INT0
Pin Name
PC3
Mode
Rising edge Falling edge High level Rising edge Falling edge Rising edge Falling edge Rising edge Falling edge
Setting Method
IIMC = 0, INT0EDGE = 0 IIMC = 0, INT0EDGE = 1 IIMC = 1 INT1EDGE = 0 INT1EDGE = 1 INT2EDGE = 0 INT2EDGE = 1 INT3EDGE = 0 INT3EDGE = 1
INT1 INT2 INT3
PC1 PC5 PC6
92C820-48
2007-02-16
TMP92C820
(3) SIO receive interrupt control Symbol Name Address 7 6 5 4 3 2
IR2LE W SIO SIMC interrupt mode control 1 F5H (Prohibit RMW) edge mode level mode
1
IR1LE W 1 edge mode level mode
0
IR0LE W 1 edge mode level mode
0: INTRX2 0: INTRX1 0: INTRX0
1: INTRX2 1: INTRX1 1: INTRX0
INTRX0 rising edge enable 0 1 Rising edge detect INTRX0 "H" level INTRX0
INTRX1 level enable 0 1 Rising edge detect INTRX1 "H" level INTRX1
INTRX2 level enable 0 1 Rising edge detect INTRX2 "H" level INTRX2
92C820-49
2007-02-16
TMP92C820
(4) Interrupt request flag clear register The interrupt request flag is cleared by writing the appropriate micro DMA start vector, as given in Table 3.4.1 to the register INTCLR.
8H
For example, to clear the interrupt flag INT0, perform the following register operation after execution of the DI instruction.
INTCLR 0AH ; Clears interrupt request flag INT0.
Symbol
Name
Interrupt clear control
Address
F8H (Prohibit RMW)
7
CLRV7
6
CLRV6 0
5
CLRV5 0
4
CLRV4 W 0
3
CLRV3 0
2
CLRV2 0
1
CLRV1 0
0
CLRV0 0
INTCLR
0
Interrupt vector
(5) Micro DMA start vector registers These registers assign micro DMA processing to an sets which source corresponds to DMA. The interrupt source whose micro DMA start vector value matches the vector set in one of these registers is designated as the micro DMA start source. When the micro DMA transfer counter value reaches zero, the micro DMA transfer end interrupt corresponding to the channel is sent to the interrupt controller, the micro DMA start vector register is cleared, and the micro DMA start source for the channel is cleared. Therefore, in order for micro DMA processing to continue, the micro DMA start vector register must be set again during processing of the micro DMA transfer end interrupt. If the same vector is set in the micro DMA start vector registers of more than one channel, the lowest numbered channel takes priority. Accordingly, if the same vector is set in the micro DMA start vector registers for two different channels, the interrupt generated on the lower-numbered channel is executed until micro DMA transfer is complete. If the micro DMA start vector for this channel has not been set in the channel's micro DMA start vector register again, micro DMA transfer for the higher-numbered channel will be commenced. (This process is known as micro DMA chaining.)
92C820-50
2007-02-16
TMP92C820
Symbol
Name
DMA0 start vector
Address
7
6
5
DMA0V5
4
DMA0V4 0 DMA1V4 0 DMA2V4 0
3
DMA0V3 0 DMA1V3 0 DMA2V3 0 R/W
2
DMA0V2 0 DMA1V2 0 DMA2V2 0
1
DMA0V1 0 DMA1V1 0 DMA2V1 0
0
DMA0V0 0 DMA1V0 0 DMA2V0 0
DMA0V
100H
0 DMA1V5
DMA0 start vector DMA1 start vector R/W 0 DMA2V5 DMA2V DMA2 start vector 102H 0 DMA1 start vector R/W DMA2 start vector DMA3V5 DMA3V DMA3 start vector 103H 0 DMA4V5 DMA4V DMA4 start vector 104H 0 DMA5V5 DMA5V DMA5 start vector 105H 0 DMA6V5 DMA6V DMA6 start vector 106H 0 DMA7V5 DMA7V DMA7 start vector 107H 0 DMA3V4 0 DMA4V4 0 DMA5V4 0 DMA6V4 0 DMA7V4 0 DMA3V3 0 DMA4V3 0 DMA5V3 0 DMA6V3 0 DMA7V3 0 DMA3V2 0 DMA4V2 0 DMA5V2 0 DMA6V2 0 DMA7V2 0 DMA3V1 0 DMA4V1 0 DMA5V1 0 DMA6V1 0 DMA7V1 0 DMA3V0 0 DMA4V0 0 DMA5V0 0 DMA6V0 0 DMA7V0 0
DMA1V
101H
R/W DMA3 start vector R/W DMA4 start vector R/W DMA5 start vector R/W DMA6 start vector R/W DMA7 start vector
92C820-51
2007-02-16
TMP92C820
(6) Specification of a micro DMA burst Specifying the micro DMA burst function causes micro DMA transfer, once started, to continue until the value in the transfer counter register reaches zero. Setting any of the bits in the register DMAB which correspond to a micro DMA channel (as shown below) to 1 specifies that any micro DMA transfer on that channel will be a burst transfer. Symbol Name
DMA burst
Address
7
DBST7
6
DBST6 0
5
DBST5 0
4
DBST4 R/W 0
3
DBST3 0
2
DBST2 0
1
DBST1 0
0
DBST0 0
DMAB
108H
0
1: DMA request on Burst mode
92C820-52
2007-02-16
TMP92C820
(7) Notes The instruction execution unit and the bus interface unit in this CPU operate independently. Therefore, if immediately before an interrupt is generated, the CPU fetches an instruction which clears the corresponding interrupt request flag, the CPU may execute this instruction in between accepting the interrupt and reading the interrupt vector. In this case, the CPU will read the default vector 0004H and jump to interrupt vector address FFFF04H. To avoid this, an instruction which clears an interrupt request flag should always be preceded by a DI instruction. And in the case of setting an interrupt enable again by EI instruction after the execution of clearing instruction, execute EI instruction after clearing and more than 3-instructions (e.g., "NOP" x 3 times). If placed EI instruction without waiting NOP instruction after execution of clearing instruction, interrupt will be enable before request flag is cleared. In the case of changing the value of the interrupt mask register by execution of POP SR instruction, disable an interrupt by DI instruction before execution of POP SR instruction. In addition, please note that the following two circuits are exceptional and demand special attention.
INT0 level mode In level mode INT0 is not an edge-triggered interrupt. Hence, in level mode the interrupt request flip-flop for INT0 does not function. The peripheral interrupt request passes through the S input of the flip-flop and becomes the Q output. If the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. If the CPU enters the interrupt response sequence as a result of INT0 going from 0 to 1, INT0 must then be held at 1 until the interrupt response sequence has been completed. If INT0 is set to level mode so as to release a halt state, INT0 must be held at 1 from the time INT0 changes from 0 to 1 until the halt state is released. (Hence, it is necessary to ensure that input noise is not interpreted as a 0, causing INT0 to revert to 0 before the halt state has been released.) When the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. Interrupt request flags must be cleared using the following sequence. DI LD (IIMC), 00H NOP NOP NOP EI INTRX In edge mode (The register SIMC set to "0"), the interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. It cannot be cleared by writing INTCLR register. ; Switches from level to edge. ; Wait EI execution LD (INTCLR), 0AH ; Clears interrupt request flag.
Note: The following instructions or pin input state changes are equivalent to instructions which clear the interrupt request flag. INT0: Instructions which switch to level mode after an interrupt request has been generated in edge mode. The pin input changes from high to low after an interrupt request has been generated in level mode. ("H" "L") INTRX: Instructions which read the receive buffer.
92C820-53
2007-02-16
TMP92C820
3.5
Function of Ports
TMP92C820 has I/O port pins that are shown in Table 3.5.1. In addition to functioning as general-purpose I/O ports, these pins are also used by internal CPU and I/O functions. Table 3.5.2 lists I/O registers and their specifications.
0H 1H
Table 3.5.1 Port Functions (1/2)
(R: PU = with programmable pull-up resistor, U = with pull-up resistor)
Port Name
Port 1 Port 2 Port 3 Port 4 Port 5 Port 6 Port 7
Pin Name
P10 to P17 P20 to P27 P30 to P37 P40 to P47 P50 to P57 P60 to P67 P70 P71 P72 P73 P74 P75 P76
Number of Pins
8 8 8 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 1 1 1
I/O
I/O I/O I/O I/O* I/O* I/O* Output Output Output Output Output Output I/O Output Output Output Output Output Output Output Output I/O I/O I/O I/O I/O I/O I/O Input I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O
R
- - - - - - - - - - - - - - - - - - - - - - - - - - - - U - - - - - - - - - - -
I/O Setting
Bit Bit Bit Bit* Bit* Bit* (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit Bit Bit Bit Bit Bit Bit (Fixed) Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
Pin Name for Built-in Function
D8 to D15 D16 to D23 D24 to D31 A0 to A7 A8 to A15 A16 to A23
RD
WRLL
WRLU
WRUL WRUU
R/ W
WAIT CS0 , SDCSH CS1 , SDCSL CS2 , CS2A CS3
Port 8
P80 P81 P82 P83 P84 P85 P86 P87
EA24, CS2B EA25, CS2C
CS2D
SDCLK SCK SO, SDA SI, SCL
CS2E CS2F CS2G , TXD2 CSEXA , RXD2
Port 9
P90 P91 P92 P93 P94 P95 P96
Port A Port C
PA0 to PA7 PC0 PC1 PC3 PC5 PC6
KI0 to KI7 TA0IN INT1, TA1OUT INT0 INT2, TA3OUT INT3, TB0OUT0 TXD0 RXD0 SCLK0, CTS0 TXD1 RXD1 SCLK1, CTS1
Port F
PF0 PF1 PF2 PF3 PF4 PF5
*: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
92C820-54
2007-02-16
TMP92C820
Table 3.5.1 Port Functions (2/2)
(R: PU = with programmable pull-up resistor, U = with pull-up resistor)
Port Name
Port G Port J
Pin Name
PG0 to PG4 PJ0 PJ1 PJ2 PJ3 PJ4 PJ5 PJ6 PJ7
Number of Pins
5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8
I/O
Input Output Output Output Output Output Output Output Output Output Output Output Output Output Output I/O
R
- - - - - - - - - - - - - - - -
I/O Setting
(Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit
Pin Name for Built-in Function
AN0 to AN4, ADTRG (PG3)
SDRAS SDCAS SDWE , SRWR SDLLDQM , SRLLB
SDLUDQM , SRLUB
SDULDQM , SRULB
SDUUDQM , SRUUB
SDCKE D1BSCP D2BLP D3BFR DLEBCD DOFFB
ALARM , MLDALM
Port K
PK0 PK1 PK2 PK3 PK4 PK6
Port L
PL0 to PL7
LD0 to LD7
92C820-55
2007-02-16
TMP92C820
Table 3.5.2 I/O Registers and Specifications (1/3) Port
Port 1
Pin Name
P10 to P17 Input port Output port
Specification Pn
X X X X X X X X X X X X X X X X X X X 0 1 X 0 1 X 0 1 X 0* 1* 0 0* 1* 0 0* 1* 0 None
I/O Register PnCR PnFC PnFC2 PnODE
0 1 0 1 0 1 0 1 0 1 0 1 0 None None None None None None None None None None None None
D8 to D15 bus Port 2 P20 to P27 Input port Output port D16 to D23 bus Port 3 P30 to P37 Input port Output port D24 to D31 bus Port 4 P40 to P47 Input port* Output port* A0 to A7 output Port 5 P50 to P57 Input port* Output port* A8 to A15 output Port 6 P60 to P67 Input port* Output port* A16 to A23 output Port 7 P70 to P75 P70 P71 P72 P73 P74 P75 P76 Output port
RD output WRLL output WRLU output WRUL output WRUU output
X
None
1 None None
R/ W output Input port Output port
WAIT input
X X X X X X X X X X X X X X X X
0 1 0
0 0 1 0 1 1 X 1 X 1 1 X 1 X X 1 0 0 0 1 0 1 0 0 1 0 1 1 0
Port 8
P80 to P87 P80 P81 P82 P83 P84 P85 P86 P87
Output port CS0 output CS1 output SDCS output CS2 output CS2A output CS3 output EA24 output CS2B output EA25 output CS2C output CS2D output SDCLK output
None
None
X: Don't care *: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
92C820-56
2007-02-16
TMP92C820
Table 3.5.2 I/O Registers and Specifications (2/3) Port
Port 9
Pin Name
P90 to P96 P90 P91 P92 P93 Input port Output port SCK input
Specification Pn
X X X X X X X X X X X X X X X X X X X X X X X X X X X 0 X 0 1 0 1 X X 1 1 X 1 1 1 1 X 1 1 X X X 0 1 0 X 1 X 0 X 1 0 0 0 1 0 0 0 1 0 0 1 0 None 0 1 X 1 0 0 0 1 0 1 0 1 0 1 0 0/1 0 0 1 0 0/1 0 None
I/O Register PnCR PnFC PnFC2 PnODE
0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 None 1 1 1 1 None 1 1 None None None None None None None 0 0 0 0/1 0/1 1 0 1 X X 0 1 X X 0 1 X 0 1 X X None
SCK output SO output SDA SI input SCL
CS2E output
P94
SSCMD input SSCMD output SSCMD (Open drain) CS2F output SSDAT input SSDAT output SSDAT (Open drain) CS2G output TXD2 output TXD2 (Open drain) CSEXA output RXD2 input Input port KI0 to KI7 input Input port Output port TA0IN input TA1OUT output INT1 input INT0 input INT2 input TA3OUT INT3 input TB0OUT0 Input port Output port TXD0 TXD0 (Open drain) RXD0 input SCLK0 input/output CTS0 input TXD1 TXD1 (Open drain) RXD1 input SCLK1 input/output CTS1 input Input port AN0 to AN4 input ADTRG input
P95
P96 Port A Port C PA0 to PA7 PC0, PC1, PC3 PC5, PC6 PC0 PC1 PC3 PC5 PC6 Port F PF0 to PF5 PF0 PF1 PF2 PF3 PF4 PF5 Port G PG0 to PG4 PG3
None
None
X: Don't care
92C820-57
2007-02-16
TMP92C820
Table 3.5.2 I/O Registers and Specifications (3/3) Port
Port J
Pin Name
PJ0 to PJ7 PJ0 PJ1 PJ2 PJ3
Specification Pn
Output port SDRAS output
SDCAS output SDWE output SRWR output
I/O Register PnCR PnFC PnFC2 PnODE
0 1 1 1 X 1 X None 1 X 1 X 1 X 1 0 1 1 None 1 1 1 1 1 0 0 1 None None None None 0 0 0 0 1 0 1 0 1 0 1 0 1 0 None X X X X X X X X X X X X X X X X X X X X 1 0 X X X
SDLLDQM output
SRLLB output
PJ4
SDLUDQM output SRLUB output
PJ5
SDULDQM output
SRULB output
PJ6
SDUUDQM output
SRUUB output
Port K
PJ7 PK0 to PK6 PK0 PK1 PK2 PK3 PK4 PK6
SDCKE output Output port D1BSCP output D2BLP output D3BFR output DLEBCD output DOFFB output ALARM output MLDALM output Input port Output port LD0 to LD7 output
Port L
PL0 to PL7
0 1 X
X: Don't care After a reset the port pins listed below function as general-purpose I/O port pins. A reset sets I/O pins, which can be programmed for either input, or output to be input ports pins. Setting the port pins for internal function use must be done in software.
92C820-58
2007-02-16
TMP92C820 3.5.1 Port 1 (P10 to P17)
Port 1 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or outputs by control register P1CR and function register P1FC. In addition to functioning as a general-purpose I/O port, port 1 can also function as a data bus (D8 to D15). AM1 AM0
0 0 1 1 0 1 0 1 Reset
Function Setting after Reset is Released
Don't use this setting Data bus (D8 to D15) Data bus (D8 to D15) Don't use this setting
Direction control (on bit basis)
P1CR write
Function control (on bit basis) Internal data bus
External access (Data write)
P1FC write S Output latch A Selector P1 write D8 to D15 Output buffer B Port 1 P10 to P17 (D8 to D15)
P1 read
External access (Data read)
Figure 3.5.1 Port 1
92C820-59
2007-02-16
TMP92C820
Port 1 Register 7
P1 (0004H) Bit symbol Read/Write After reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Data from external port (Output latch register is cleared to 0)
Port 1 Control Register 7
P1CR (0006H) Bit symbol Read/Write After reset Function 0 0 0 0 P17C
6
P16C
5
P15C
4
P14C W
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
Refer to port 1 function setting
Port 1 Function Register 7
P1FC (0007H) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
P1F W 1 Refer to port 1 function setting
Port 1 function register Note 1:Read-modify-write is prohibited for the registers P1CR and P1FC. Note 2: show X bit of P1CR register. 0 1 Input port Output port Data bus (D15 to D8) P1FC P1CR 0 1
Figure 3.5.2 Register for Port 1
92C820-60
2007-02-16
TMP92C820 3.5.2 Port 2 (P20 to P27)
Port 2 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or outputs by control register P2CR and function register P2FC. In addition to functioning as a general-purpose I/O port, port 2 can also function as a data bus (D16 to D23). Function Setting after Reset is Released
Don't use this setting Input port Data bus (D16 to D23) Don't use this setting
AM1 AM0
0 0 1 1 0 1 0 1
Reset
Direction control (on bit basis)
P2CR write
Function control (on bit basis) Internal data bus
External access (Data write)
P2FC write S Output latch A Selector P2 write D16 to D23 Output buffer B Port 2 P20 to P27 (D16 to D23)
P2 read
External access (Data read)
Figure 3.5.3 Port 2
92C820-61
2007-02-16
TMP92C820
Port 2 Register 7
P2 (0008H) Bit symbol Read/Write After reset P27
6
P26
5
P25
4
P24 R/W
3
P23
2
P22
1
P21
0
P20
Data from external port (Output latch register is cleared to 0)
Port 2 Control Register 7
P2CR (000AH) Bit symbol Read/Write After reset Function 0 0 0 0 P27C
6
P26C
5
P25C
4
P24C W
3
P23C 0
2
P22C 0
1
P21C 0
0
P20C 0
0: Input 1: Output
Port 2 Function Register 7
P2FC (000BH) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
P2F W 0/1 Note2 0: Port 1: Data bus (D16 to D23)
Port 2 function register Note 1:Read-modify-write is prohibited for the registers P2CR and P2FC. Note 2: It is set to "Port" or "Data bus" by AM pin setting. Note 3: show X bit of P2CR register. P2FC P2CR 0 1 0 Input port Output port 1
Data bus (D16 to D23)
Figure 3.5.4 Register for Port 2
92C820-62
2007-02-16
TMP92C820 3.5.3 Port 3 (P30 to P37)
Port 3 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or outputs by control register P3CR and function register P3FC. In addition to functioning as a general-purpose I/O port, port 3 can also function as a data bus (D24 to D31). AM1 AM0
0 0 1 1 0 1 0 1 Reset
Function Setting after Reset is Released
Don't use this setting Input port Data bus (D24 to D31) Don't use this setting
Direction control (on bit basis)
P3CR write
Function control (on bit basis) Internal data bus
External access (Data write)
P3FC write S Output latch A Selector P3 write D24 to D31 Output buffer B Port 3 P30 to P37 (D24 to D31)
P3 read
External access (Data read)
Figure 3.5.5 Port 3
92C820-63
2007-02-16
TMP92C820
Port 3 Register 7
P3 (000CH) Bit symbol Read/Write After reset P37
6
P36
5
P35
4
P34 R/W
3
P33
2
P32
1
P31
0
P30
Data from external port (Output latch register is cleared to 0)
Port 3 Control Register 7
P3CR (000EH) Bit symbol Read/Write After reset Function 0 0 0 0 P37C
6
P36C
5
P35C
4
P34C W
3
P33C 0
2
P32C 0
1
P31C 0
0
P30C 0
0: Input 1: Output
Port 3 Function Register 7
P3FC (000FH) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
P3F W 0/1 Note2 0: Port 1: Data bus (D24 to D31)
Port 3 function register Note 1:Read-modify-write is prohibited for the registers P3CR and P3FC. Note 2: It is set to "Port" or "Data bus" by AM pin setting. Note 3: show X bit of P3CR register. 0 1 Input port Output port Data bus (D24 to D31) P3FC P3CR 0 1
Figure 3.5.6 Register for Port 3
92C820-64
2007-02-16
TMP92C820 3.5.4 Port 4 (P40 to P47)
Port 4 is an 8-bit general-purpose I/O ports*. Bits can be individually set as either inputs or outputs by control register P4CR and function register P4FC*. In addition to functioning as a general-purpose I/O port, port 4 can also function as an address bus (A0 to A7). AM1 AM0
0 0 1 1 0 1 0 1 Reset Internal address bus A0 to A7 Direction control (on bit basis)*
Function Setting after Reset is Released
Don't use this setting Address bus (A0 to A7) Address bus (A0 to A7) Don't use this setting
P4CR write
Internal data bus
Function control (on bit basis) S B P4FC write Selector Output buffer Output latch A Port 4 P40 to P47 (A0 to A7)
P4 write
P4 read *: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.7 Port 4
92C820-65
2007-02-16
TMP92C820
Port 4 Register 7
P4 (0010H) Bit symbol Read/Write After reset P47
6
P46
5
P45
4
P44 R/W
3
P43
2
P42
1
P41
0
P40
Data from external port (Output latch register is cleared to 0)
Port 4 Control Register 7
P4CR (0012H) Bit symbol Read/Write After reset Function 0 0 0 0 P47C
6
P46C
5
P45C
4
P44C W
3
P43C 0
2
P42C 0
1
P41C 0
0
P40C 0
0: Input 1: Output (Note2)
Port 4 Function Register 7
P4FC (0013H) Bit symbol Read/Write After reset Function 1 1 1 1 P47F
6
P46F
5
P45F
4
P44F W
3
P43F 1
2
P42F 1
1
P41F 1
0
P40F 1
0: Port 1: Address bus (A0 to A7) (Note2)
Note1: Read-modify-write is prohibited for the registers P4CR and P4FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.8 Port 4 Registers
92C820-66
2007-02-16
TMP92C820 3.5.5 Port 5 (P50 to P57)
Port 5 is an 8-bit general-purpose I/O ports*. Bits can be individually set as either inputs or outputs by control register P5CR and function register P5FC*. In addition to functioning as a general-purpose I/O port, port 5 can also function as an address bus (A8 to A15). AM1 AM0
0 0 1 1 0 1 0 1 Reset Internal address bus A8 to A15 Direction control (on bit basis)*
Function Setting after Reset is Released
Don't use this setting Address bus (A8 to A15) Address bus (A8 to A15) Don't use this setting
P5CR write
Internal data bus
Function control (on bit basis) S B P5FC write Selector Output buffer Output latch A Port 5 P50 to P57 (A8 to A15)
P5 write
P5 read *: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.9 Port 5
92C820-67
2007-02-16
TMP92C820
Port 5 Register 7
P5 (0014H) Bit symbol Read/Write After reset P57
6
P56
5
P55
4
P54 R/W
3
P53
2
P52
1
P51
0
P50
Data from external port (Output latch register is cleared to 0)
Port 5 Control Register 7
P5CR (0016H) Bit symbol Read/Write After reset Function 0 0 0 0 P57C
6
P56C
5
P55C
4
P54C W
3
P53C 0
2
P52C 0
1
P51C 0
0
P50C 0
0: Input 1: Output (Note2)
Port 5 Function Register 7
P5FC (0017H) Bit symbol Read/Write After reset Function 1 1 1 1 P57F
6
P56F
5
P55F
4
P54F W
3
P53F 1
2
P52F 1
1
P51F 1
0
P50F 1
0: Port 1: Address bus (A8 to A15) (Note2)
Note1: Read-modify-write is prohibited for the registers P5CR and P5FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.10 Register for Port 5
92C820-68
2007-02-16
TMP92C820 3.5.6 Port 6 (P60 to P67)
Port 6 is an 8-bit general-purpose I/O ports*. Bits can be individually set as either inputs or outputs by control register P6CR and function register P6FC*. In addition to functioning as a general-purpose I/O port, port 6 can also function as an address bus (A16 to A23). AM1 AM0
0 0 1 1 0 1 0 1 Reset Internal address bus A16 to A23 Direction control (on bit basis)*
Function Setting after Reset is Released
Don't use this setting Address bus (A16 to A23) Address bus (A16 to A23) Don't use this setting
P6CR write
Internal data bus
Function control (on bit basis) S B P6FC write Selector Output buffer Output latch A Port 6 P60 to P67 (A16 to A23)
P6 write
P6 read *: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.11 Port 6
92C820-69
2007-02-16
TMP92C820
Port 6 Register 7
P6 (0018H) Bit symbol Read/Write After reset P67
6
P66
5
P65
4
P64 R/W
3
P63
2
P62
1
P61
0
P60
Data from external port (Output latch register is cleared to 0)
Port 6 Control Register 7
P6CR (001AH) Bit symbol Read/Write After reset Function 0 0 0 0 P67C
6
P66C
5
P65C
4
P64C W
3
P63C 0
2
P62C 0
1
P61C 0
0
P60C 0
0: Input 1: Output (Note2)
Port 6 Function Register 7
P6FC (001BH) Bit symbol Read/Write After reset Function 1 1 1 1 P67F
6
P66F
5
P65F
4
P64F W
3
P63F 1
2
P62F 1
1
P61F 1
0
P60F 1
0: Port 1: Address bus (A16 to A23) (Note2)
Note1: Read-modify-write is prohibited for the registers P6CR and P6FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.12 Port 6 Registers
92C820-70
2007-02-16
TMP92C820 3.5.7 Port 7 (P70 to P76)
Port 7 is a 7-bit general-purpose I/O port (P70 to P75 are used for output only). Bits can be individually set as either inputs or outputs by control register P7CR and function register P7FC. In addition to functioning as a general-purpose I/O port, P70 to P75 pins can also function as read/write strobe signals to connect with an external memory. P76 pin can also function as wait input. A reset initializes P70 to P75 pins to output port mode, and P76 pin to input port mode. AM1 AM0
0 0 1 1 0 1 0 1
Function Setting after Reset is Released
Don't use this setting
RD pin RD pin
Don't use this setting
Reset
Function control (on bit basis) Internal data bus
P7FC write S Output latch A Selector P7 write B Output buffer P70 ( RD )
P7 read
RD
Figure 3.5.13 Port 7 (P70)
92C820-71
2007-02-16
TMP92C820
Reset
Function control (on bit basis) Internal data bus
P7FC write S Output latch A Selector P7 write B Output buffer P71 ( WRLL ) P72 ( WRLU ) P73 ( WRUL ) P74 ( WRUU )
P7 read
WRLL , WRLU , WRUL , WRUU
Figure 3.5.14 Port 7 (P71 to P74)
Reset
Function control (on bit basis) Internal data bus
P7FC write S Output latch A Selector P7 write B Output buffer P75 (R/ W )
P7 read
R/ W
Figure 3.5.15 Port 7 (P75)
92C820-72
2007-02-16
TMP92C820
Reset
Function control (on bit basis) P7FC write
Direction control (on bit basis)
P7CR write Internal data bus S Output latch Output buffer P7 write
P76 ( WAIT )
P7 read Internal wait signal
Figure 3.5.16 Port 7 (P76)
92C820-73
2007-02-16
TMP92C820
Port 7 Register 7
P7 (001CH) Bit symbol Read/Write After reset Data from external port (Note) 1 1
6
P76
5
P75
4
P74
3
P73 R/W 1
2
P72 1
1
P71 1
0
P70 1
Note: Output latch register is cleared to 0.
Port 7 Control Register 7
P7CR (001EH) Bit symbol Read/Write After reset Function
6
P76C W 0 0: Input 1: Output
5
4
3
2
1
0
Port 7 Function Register
P7FC (001FH)
7
Bit symbol Read/Write After reset Function
6
P76F 0 0: Port 1: WAIT
5
P75F 0 0: Port 1: R/ W
4
P74F 0 0: Port 1: WRUU
3
P73F W 0 0: Port 1: WRUL
2
P72F 0 0: Port 1: WRLU
1
P71F 0 0: Port 1: WRLL
0
P70F 1 0: Port 1: RD
Note: Read-modify-write is prohibited for the registers P7CR and P7FC.
Figure 3.5.17 Register for Port 7
92C820-74
2007-02-16
TMP92C820 3.5.8 Port 8 (P80 to P87)
Ports 80 to 87 are 8-bit output ports. Resetting sets output latch of P82 to "0" and output latches of P80 to P81, P83 to P87 to "1". Port 8 also function as chip-select output ( CS0 to CS3 ), extend address output (EA24, EA25), extend chip-select output ( CS2A , CS2B , CS2C , CS2D ), port 8 also function as output pin for SDRAM controller ( SDCSL , SDCSH , SDCLK), Above setting is used the function register P8FC. Writing "1" in the corresponding bit of P8FC, P8FC2 enables the respective functions. Resetting resets P87F of P8FC to "1", P80F to P86F of P8FC to "0", and P8FC2 to "0", sets all bits to output ports.
Reset
Function control 2 (on bit basis)
P8FC2 write
Internal data bus
Function control (on bit basis)
P8FC write S Output lacth A Selector B P8 write C P80 ( CS0 , SDCSH ) P81 ( CS1 , SDCSL ) P82 ( CS2 , CS2A ) P83 ( CS3 ) P84 (EA24, CS2B ) P85 (EA25, CS2C ) P86 ( CS2D ) P87 (SDCLK)
SDCSH , SDCSL , CS2A , "1", CS2B , CS2C , CS2D , "1"
P8 read
CS0 , CS1 , CS2 , CS3 , EA24, EA25, "1", SDCLK
Figure 3.5.18 Port 8
92C820-75
2007-02-16
TMP92C820
Port 8 Register 7
P8 (0020H) Bit symbol Read/Write After reset 1 1 1 1 P87
6
P86
5
P85
4
P84 R/W
3
P83 1
2
P82 0
1
P81 1
0
P80 1
Port 8 Function Register 7
P8FC (0023H) Bit symbol Read/Write After reset Function 1 0: Port 1: SDCLK 0 Always write "0". 0 0: Port 1: EA25 0 0: Port 1: EA24 P87F
6
-
5
P85F
4
P84F W
3
P83F 0 0: Port 1: CS3
2
P82F 0 0: Port 1: CS2
1
P81F 0 0: Port 1: CS1
0
P80F 0 0: Port 1: CS0
Port 8 Function Register 2 7
P8FC2 (0021H) Bit symbol Read/Write After reset Function 0 Always write "0". 0 0: 1: CS2D 0 0: 1: CS2C 0 0: 1: CS2B -
6
P86F2
5
P85F2
4
P84F2 W
3
- 0 Always write "0".
2
P82F2 0 0: 1: CS2A
1
P81F2 0 0: 1: SDCSL
0
P80F2 0 0: 1: SDCSH
Note :Read-modify-write is prohibited for P8FC and P8FC2 .
Figure 3.5.19 Registers for Port 8
92C820-76
2007-02-16
TMP92C820 3.5.9 Port 9 (P90 to P96)
P90 to P96 are 7-bit general-purpose I/O port. I/O can be set on bit basis using the control register. Resetting sets port 9 to input port and all bits of output latch to "1". Writing in the corresponding bit of P9FC enables the respective functions. Resetting resets the P9FC to "0", and sets all bits to input ports. (1) Port 90 (SCK), port 91 (SO/SDA), and port 92 (SI/SCL) Ports 90 to 92 are general-purpose I/O port. It is also used as SCK (Clock signal for SIO mode), SO (Data output for SIO mode), SDA (Data input for I2C mode), SI (Data input for SIO mode), and SCL (Clock input/output for I2C mode) for serial bus interface.
Reset
Direction control (on bit basis)
P9CR write
Internal data bus
Function control (on bit basis)
P9FC write S Output latch P90 (SCK) P91 (SO/SDA) P92 (SI/SCL) Open-drain possible P9ODE S B Selector P9 read SCK input SDA input SI/SCL input A
S A Selector B
P9 write
SCK output SO output SDA output SCL output
Figure 3.5.20 Port 9 (P90 to P92)
92C820-77
2007-02-16
TMP92C820
(2) Ports 93 ( CS2E ), 94 ( CS2F ), 95 (TXD2, CS2G ), and 96 (RXD2, CSEXA ) Ports 93 to 96 are general-purpose I/O ports.
Reset
Direction control (on bit basis)
P9CR write Internal data bus
Function control (on bit basis)
P9FC write S Output latch P93 ( CS2E ) P94 ( CS2F ) P95 (TXD2, CS2G ) Open-drain possible P9ODE
P9 write TXD2 CS2E , CS2F , CS2G
S A Selector B C S B Selector
(Except P95)
P9 read
A
Figure 3.5.21 Port 9 (P93 to P95)
Reset
Direction control (on bit basis)
P9CR write Internal data bus
Function control (on bit basis)
P9FC write S Output latch
S A Selector B S B Selector
P96 (RXD2, CSEXA )
P9 write
CSEXA
P9 read RXD2
A
Figure 3.5.22 Port 9 (P96)
92C820-78
2007-02-16
TMP92C820
Port 9 Register 7
P9 (0024H) Bit symbol Read/Write After reset
6
P96
5
P95
4
P94
3
P93 R/W
2
P92
1
P91
0
P90
Data from external port (Output latch register is set to 1)
Port 9 Control Register 7
P9CR (0026H) Bit symbol Read/Write After reset Function 0 0 0
6
P96C
5
P95C
4
P94C
3
P93C W 0 0: Input 1: Output
2
P92C 0
1
P91C 0
0
P90C 0
Port 9 Function Register 7
P9FC (0027H) Bit symbol Read/Write After reset Function 0 0: Port 1: RXD2,
CSEXA
6
P96F
5
P95F 0 0: Port 1: TXD2,
CS2G
4
P94F 0 0: Port 1: CS2F
3
P93F W 0 0: Port 1: CS2E
2
P92F 0 0: Port, SI, 1: SCL Note 2
1
P91F 0 0: Port 1: SO, SDA
0
P90F 0 0: Port, SCK input 1: SCK Output Note 2
CS2E setting

0 Input port (Reserved)
1 Output port
CS2E
0 1
CS2F setting

0 Input port (Reserved)
1 Output port
CS2F
0 1

TXD2, CS2G setting 0 Input port TXD2 1 Output port
CS2G
0 1
Port 9 ODE Register 7
P9ODE (0025H) Bit symbol Read/Write After reset Function
6
5
P95ODE W 0 0: 3 states 1: Open drain
4
- W 0 Always write "0".
3
- W 0 Always write "0".
2
P92ODE W 0 0: 3 states 1: Open drain
1
P91ODE W 0 0: 3 states 1: Open drain
0
Note 1: Read-modify-write is prohibited for P9CR, P9FC, and P9ODE. Note 2: When using SI and SCK input function, set P9FC to "0" (Function setting).
Figure 3.5.23 Register for Port 9
92C820-79
2007-02-16
TMP92C820 3.5.10 Port A (PA0 to PA7)
Ports A0 to A7 are 8-bit input ports with pull-up resistor. In addition to functioning as general-purpose I/O ports, ports A0 to A7 can also key-on wakeup function as keyboard interface. The various functions can each be enabled by writing a "1" to the corresponding bit of the port A function register (PAFC). Resetting resets all bits of the register PAFC to "0" and sets all pins to be input port.
INTKEY Start edge detection Internal data bus PA0 to PA7 8-input OR
Reset Key-on enable (on bit basis) PAFC write PA0 to PA7 (KI0 to KI7) PA read
Pull-up resistor
Figure 3.5.24 Port A When PAFC = "1", if either of input of KI0 to KI7 pins falls down, INTKEY interrupt is generated. INTKEY interrupt can be used release all HALT mode.
92C820-80
2007-02-16
TMP92C820
Port A Register 7
PA (0028H) Bit symbol Read/Write After reset PA7
6
PA6
5
PA5
4
PA4 R
3
PA3
2
PA2
1
PA1
0
PA0
Data from external port
Port A Function Register 7
PAFC (002BH) Bit symbol Read/Write After reset Function 0 0 0 0 PA7F
6
PA6F
5
PA5F
4
PA4F W
3
PA3F 0
2
PA2F 0
1
PA1F 0
0
PA0F 0
0: KEY-IN disable 1: KEY-IN enable
Key-IN of Port A 0 1 Note: Read-modify-write is prohibited for the registers PAFC. Disable Enable
Figure 3.5.25 Register for Port A
92C820-81
2007-02-16
TMP92C820 3.5.11 Port C (PC0, PC1, PC3, PC5 and PC6)
Port C is 5-bit general-purpose I/O port. Each bit can be set individually for input or output. Resetting sets port C to be an input port. In addition to functioning as a general-purpose I/O port, port C can also functions as I/O pin for timers (TA0IN, TA1OUT, TA3OUT, TB0OUT0), input pin for external interruption (INT0 to INT3). Above setting is used the function register PCFC and PCCR register. Edge select of external interruption establishes it with IIMC register, which there is in interruption controller. Resetting resets bits of the register PCCR and PCFC to "0" and sets all pins to be input port. (1) PC0 (TA0IN) In addition to function as I/O port, port 0 can also function as input pin TA0IN of timer channel 0.
Reset
Direction control (on bit basis)
PCCR write Internal data bus
Function control (on bit basis)
PCFC write S Output latch PC0 (TA0IN)
PC write
S B Selector A
PC read TA0IN
Figure 3.5.26 Port C (PC0) Note: Cannot read the output latch data when output mode.
92C820-82
2007-02-16
TMP92C820
(2) PC1 (INT1, TA1OUT), PC5 (INT2, TA3OUT) and PC6 (INT3, TB0OUT0)
Reset
Direction control (on bit basis)
PCCR write Internal data bus
Function control (on bit basis)
PCFC write S Output latch TA1OUT PC write TA3OUT TB0OUT0 A S PC1 (INT1, TA1OUT) PC5 (INT2, TA3OUT) PC6 (INT3, TB0OUT0) S B Selector A Rising/falling edge detection
Selector B
PC read INT1 INT2 INT3
IIMC
Figure 3.5.27 Port C (PC1, PC5, PC6) Note: Cannot read the output latch data when output mode.
92C820-83
2007-02-16
TMP92C820
(3) PC3 (INT0)
Reset
Direction control (on bit basis)
PCCR write Internal data bus
Function control (on bit basis)
PCFC write S Output latch PC3 (INT0)
PC write S B Selector A Level/edge select and Rising/falling select IIMC
PC read INT0
Figure 3.5.28 Port C (PC3)
92C820-84
2007-02-16
TMP92C820
Port C Register 7
PC (0030H) Bit symbol Read/Write After reset
6
PC6 R/W
5
PC5
4
3
PC3 R/W Data from external port (Output latch register is set to 1)
2
1
PC1 R/W
0
PC0
Data from external port (Output latch register is set to 1)
Data from external port (Output latch register is set to 1)
Port C Control Register 7
PCCR (0032H) Bit symbol Read/Write After reset Function 0
6
PC6C W
5
PC5C 0
4
3
PC3C W 0 0: Input 1: Output
2
1
PC1C W 0
0
PC0C 0
0: Input 1: Output
0: Input 1: Output
Port C Function Register 7
PCFC (0033H) Bit symbol Read/Write After reset Function 0 0: Port 1: INT3 TB0OUT0
6
PC6F W
5
PC5F 0 0: Port 1: INT2 TA3OUT
4
3
PC3F W 1 0: Port 1: INT0
2
1
PC1F W 0 0: Port 1: INT1 TA1OUT
0
PC0F 0 0: Port 1: TA0IN
INT1, TA1OUT setting

0 Input port INT1
1 Output port TA1OUT
0 1

INT2, TA3OUT setting 0 Input port INT2 1 Output port TA3OUT
0 1

INT3, TB0OUT0 setting 0 Input port INT3 1 Output port TB0OUT0
0 1 Note 1: Read-modify-write is prohibited for the registers PCCR and PCFC.
Note 2: PC0/TA0IN pin does not have a register changing port/function. For example, when it is used as an input port, the input signal is inputted to 8-bit timer. Note 3: Cannot read the output latch data when PC0, PC1, PC5, and PC6 are output mode.
Figure 3.5.29 Register for Port C
92C820-85
2007-02-16
TMP92C820 3.5.12 Port F (PF0 to PF5)
Ports F0 to F5 are 6-bit general-purpose I/O ports. Each bit can be set individually for input or output. Resetting sets PF0 to PF5 to be an input ports. It also sets all bits of the output latch register to "1". In addition to functioning as general-purpose I/O port pins, PF0 to PF5 can also function as the I/O for serial channels 0 and 1. A pin can be enabled for I/O by writing a "1" to the corresponding bit of the port F function register (PFFC). By resetting, clears all bits of the registers PFCR and PFFC to 0 and sets all pins to be input ports. (1) Ports PF0 (TXD0) and PF3 (TXD1) As well as functioning as I/O port pins, port PF0 and PF3 can also function as serial channel TXD output pins.
Reset
Direction control (on bit basis)
PFCR write Internal data bus
Function control (on bit basis)
PFFC write S Output latch
S A Selector B S B Selector
PF0 (TXD0) PF3 (TXD1) Open-drain set possible
PF write TXD0, TXD1
PF read
A
Figure 3.5.30 Port F (PF0 and PF3)
92C820-86
2007-02-16
TMP92C820
(2) Ports PF1 and PF4 (RXD0, RXD1) Ports PF1 and PF4 are I/O port pins and can also is used as RXD input for the serial channels.
Reset
Direction control (on bit basis)
PFCR write Internal data bus S Output latch PF1 (RXD0) PF4 (RXD1)
PF write S B Selector PF read RXD0, RXD1 A
Figure 3.5.31 Port F (PF1 and PF4)
92C820-87
2007-02-16
TMP92C820
(3) Ports PF2 ( CTS0 , SCLK0) and PF5 ( CTS1 , SCLK1) Ports PF2 and PF5 are I/O port pins and can also be used as CTS input or SCLK input/output for the serial channels.
Reset
Direction control (on bit basis)
PFCR write Internal data bus
Function control (on bit basis)
PFFC write S Output latch
S A Selector B S B Selector
PF2 (SCLK0, CTS0 ) PF5 (SCLK1, CTS1 )
PF write SCLK0, SCLK1 output
PF read
CTS0 , CTS1 SCLK0, SCLK1 input
A
Figure 3.5.32 Port F (PF2 and PF5)
92C820-88
2007-02-16
TMP92C820
Port F Register 7
PF (003CH) Bit symbol Read/Write After reset
6
5
PF5
4
PF4
3
PF3 R/W
2
PF2
1
PF1
0
PF0
Data from external port (Output latch register is set to 1)
Port F Control Register 7
PFCR (003EH) Bit symbol Read/Write After reset Function 0 0 0
6
5
PF5C
4
PF4C
3
PF3C W
2
PF2C 0
1
PF1C 0
0
PF0C 0
0: Input 1: Output
Port F Function Register 7
PFFC (003FH) Bit symbol Read/Write After reset Function
6
5
PF5F W 0 0: Port 1: SCLK1 output
4
3
PF3F W 0 0: Port 1: TXD1
2
PF2F 0 0: Port 1: SCLK0 output
1
0
PF0F W 0 0: Port 1: TXD0
3 states, Open-drain setting

0 Input port
TXD1 (Open drain)
1 Output port TXD1 (3 states)
0 1

0 Input port
TXD0 (Open drain)
1 Output port TXD0 (3 states)
0 1 Note 1: Note 2: Note 3:
Read-modify-write is prohibited for the registers PFCR and PFFC. PF1/RXD0 and PF4/RXD1 pins do not have a register changing Port/Function. For example, PF1 and PF3 pins dose not have a register changing 3 states/Open drain.
when it is used as an input port, the input signal is inputted to SIO as the serial receive data.
Figure 3.5.33 Register for Port F
92C820-89
2007-02-16
TMP92C820 3.5.13 Port G (PG0 to PG4)
PG0 to PG4 are 5-bit input port and can also be used as the analog input pins for the internal AD converter. PG3 can also be used as ADTRG pin for the AD converter.
Internal data bus
PG read Convertion result register AD convertor Channel selector
Port G PG0 to PG4 (AN0 to AN4)
AD read
ADTRG (only PG3)
Figure 3.5.34 Port G Port G Register 7
PG (0040H) Bit symbol Read/Write After reset Note: converter mode register ADMOD1.
6
5
4
PG4
3
PG3
2
PG2 R Data from external port
1
PG1
0
PG0
The input channel selection of AD converter and the permission of ADTRG input are set by AD
Figure 3.5.35 Register for Port G
92C820-90
2007-02-16
TMP92C820 3.5.14 Port J (PJ0 to PJ7)
PJ0 to PJ7 are 8-bit output port. Resetting sets the output latch PJ to "1" and PJ0 to PJ7 pins output "1". In addition to functioning as output port, port J also functions as output pins for SDRAM ( SDRAS , SDCAS , SDWE , SDLLDQM, SDLUDQM, SDULDQM, SDUUDQM, SDCKE) and SRAM ( SRWR , SRLLB , SRLUB , SRULB , SRUUB ). Above setting is used the function register PJFC.
Reset
Function control2 (on bit basis)
PJFC2 write Internal data bus
Function control (on bit basis)
PJFC write
Output latch
PJ write
S A Selector B C
Outpt buffer
PJ0 ( SDRAS ) PJ1 ( SDCAS ) PJ2 ( SDWE , SRWR ) PJ3 (SDLLDQM, SRLLB ) PJ4 (SDLUDQM, SRLUB ) PJ5 (SDULDQM, SRULB ) PJ6 (SDUUDQM, SRUUB ) PJ7 (SDCKE)
"1", "1", SRWR , SRLLB , SRLUB , SRULB , SRUUB , "1" PJ read
SDRAS , SDCAS , SDWE , SDLLDQM, SDLUDQM, SDULDQM, SDUUDQM, SDCKE
Figure 3.5.36 Port J
92C820-91
2007-02-16
TMP92C820
Port J Register 7
PJ (004CH) Bit symbol Read/Write After reset 1 1 1 1 PJ7
6
PJ6
5
PJ5
4
PJ4 R/W
3
PJ3 1
2
PJ2 1
1
PJ1 1
0
PJ0 1
Port J Function Register 7
PJFC (004FH) Bit symbol Read/Write After reset Function 0 0: Port 1: SDCKE 0 0: Port 0 0: Port 0 0: Port PJ7F
6
PJ6F
5
PJ5F
4
PJ4F W
3
PJ3F 0 0: Port
2
PJ2F 0 0: Port
1
PJ1F 0 0: Port 1: SDCAS
0
PJ0F 0 0: Port 1: SDRAS
1: SDUUDQM 1: SDULDQM 1: SDLUDQM 1: SDLLDQM 1: SDWE
Port J Function Register 2 7
PJFC2 (004DH) Bit symbol Read/Write After reset Function 0 Always write "0". 0 0: 1: SRUUB 0 0: 1: SRULB 0 0: 1: SRLUB -
6
PJ6F2
5
PJ5F2
4
PJ4F2 W
3
PJ3F2 0 0: 1: SRLLB
2
PJ2F2 0 0: 1: SRWR
1
- 0 Always write "0".
0
- 0 Always write "0".
Note: Read-modify-write is prohibited for the registers PJFC and PJFC2.
Figure 3.5.37 Register for Port J
92C820-92
2007-02-16
TMP92C820 3.5.15 Port K (PK0 to PK4, PK6)
Port K is 6-bit output port. Resetting sets the output latch PK to "1", and port K pins output to "1". In addition to functioning as output ports, port K also functions as output pins for LCD controller (D1BSCP, D2BLP, D3BFR, DLEBCD and DOFFB), output pins for RTC alarm ( ALARM ) and output pin for melody/alarm generator (MLDALM, MLDALM ). Above setting is used the function register PKFC. Only PK6 has two output function which ALARM and MLDALM . This selection is used PK. Resetting resets the function register PKFC to "0", and sets all ports to output ports.
Reset
Internal data bus
Function control (on bit basis)
PKFC write S Output latch A Selector PK write B D1BSCP, D2BLP, D3BFR, DLEBCD, DOFFB Outpt buffer PK0 (D1BSCP) PK1 (D2BLP) PK2 (D3BFR) PK3 (DLEBCD) PK4 (DOFFB)
PK read
Figure 3.5.38 Port K (PK0 to PK4)
92C820-93
2007-02-16
TMP92C820
Reset
Function control (on bit basis)
Internal data bus
PKFC write S Output latch
S A Selector B
PK6 ( ALARM , MLDALM )
PK write
PF read
MLDALM ALARM
S A Selector B
Figure 3.5.39 Port K (PK6) Port K Register 7
PK (0050H) Bit symbol Read/Write After reset
6
PK6 R/W 1
5
4
PK4 1
3
PK3 1
2
PK2 R/W 1
1
PK1 1
0
PK0 1
Port K Function Register 7
PKFC (0053H) Bit symbol Read/Write After reset Function
6
PK6F W 0 0: Port 1: ALARM at =1 1: MLDALM at =0
5
4
PK4F 0 0: Port 1: DOFFB
3
PK3F 0 0: Port
2
PK2F W 0 0: Port
1
PK1F 0 0: Port 1: D2BLP
0
PK0F 0 0: Port 1: D1BSCP
1: DLEBCD 1: D3BFR
Note: Read-modify-write is prohibited for the register PKFC.
Figure 3.5.40 Register for Port K
92C820-94
2007-02-16
TMP92C820 3.5.16 Port L (PL0 to PL7)
PL0 to PL7 are 8-bit general-purpose I/O ports. Each bit can be set individually for input or output using the control register PLCR. Resetting, the control register PLCR to "0" and sets port L to input ports. It also sets all bits of the output latch register to "1". In addition to functioning as a general-purpose I/O port, port L can also function as a data bus for LCD controller (LD0 to LD7). Above setting is used the function register PLFC.
Reset
Direction control (on bit basis)
PLCR write Internal data bus
Function control (on bit basis)
PLFC write S Output latch Port E PL0 to PL7 (LD0 to LD7)
S A Selector B S B Selector A
PL write LD7 to LD0
PL read
Figure 3.5.41 Port L
92C820-95
2007-02-16
TMP92C820
Port L Register 7
PL (0054H) Bit symbol Read/Write After reset PL7
6
PL6
5
PL5
4
PL4 R/W
3
PL3
2
PL2
1
PL1
0
PL0
Data from external port (Output latch register is set to 1)
Port L Control Register 7
PLCR (0056H) Bit symbol Read/Write After reset Function 0 0 0 0 PL7C
6
PL6C
5
PL5C
4
PL4C W
3
PL3C 0
2
PL2C 0
1
PL1C 0
0
PL0C 0
0: Input 1: Output
Port L Function Register 7
PLFC (0057H) Bit symbol Read/Write After reset Function 0 0 0 0 PL7F
6
PL6F
5
PL5F
4
PL4F W
3
PL3F 0
2
PL2F 0
1
PL1F 0
0
PL0F 0
0: Port 1: Data bus for LCDC (LD7 to LD0)
Figure 3.5.42 Register for Port L
92C820-96
2007-02-16
TMP92C820
3.6
Memory Controller
Functions
TMP92C820 has a memory controller with a variable 4-block address area that controls as follows. (1) 4-block address area support Specifies a start address and a block size for 4-block address area (Block 0 to block 5). (2) Connecting memory specifications Specifies SRAM, ROM as memories to connect with the selected address areas. (3) Data bus size selection Whether 8 bits, 16 bits or 32 bits is selected as the data bus size of the respective block address areas. (4) Wait control Wait specification bit in the control register and WAIT input pin control the number of waits in the external bus cycle. Read cycle and write cycle can specify the number of waits individually. The number of waits is controlled in five mode mentioned below. 0 waits, 1 wait, 2 waits, 3 waits N waits (control with WAIT pin)
3.6.1
92C820-97
2007-02-16
TMP92C820 3.6.2 Control Register and Operation after Reset Release
This section describes the registers to control the memory controller, the state after reset release and necessary settings. (1) Control register The control registers of the memory controller are as follows. * Control register: BnCSH/BnCSL (n = 0 to 3, EX) Sets the basic functions of the memory controller, that is the connecting memory type, the number of waits to be read and written. Memory start address register: MSARn (n = 0 to 3) Sets a start address in the selected address areas. Memory address mask register: MAMR (n = 0 to 3) Sets a block size in the selected address areas.
* *
In addition to setting of the above-mentioned registers, it is necessary to set the following registers to control ROM page mode access. * Page ROM control register: PMEMCR Sets to executed ROM page mode accessing.
(2) Operation after reset release The start data bus size is determined depending on the state of AM1/AM0 pins just after reset release. Then, the external memory is accessed as follows: AM1
0 0 1 1
AM0
0 1 0 1
Start Mode
Don't use this setting Start with 16-bit data bus Start with 32-bit data bus Don't use this setting
AM1/AM0 pins are valid only just after reset release. In the other cases, the data bus width is set to the value set to BnBUS bit of the control register. After reset, only control register (B2CSH/B2CSL) of the block address area 2 is automatically valid. The data bus width which is specified by AM1/AM0 pin is loaded to the bit to specify the bus width of the control register in the block address area 2. The block address area 2 is set to address 000000H to FFFFFFH after reset. After reset release, the block address areas are specified by the memory start address register (MSARn) and the memory address mask register (MAMRn). Then the control register (BnCS) is set. Set the enable bit (BnE) of the control register to "1" to enable the setting.
92C820-98
2007-02-16
TMP92C820 3.6.3 Basic Functions and Register Setting
In this section, setting of the block address area, the connecting memory, and the number of waits out of the memory controller's functions are described. (1) Block address area specification The block address area is specified by two registers. The memory start address register (MSARn) sets the start address of the block address areas. The memory controller compares between the register value and the address every bus cycles. The address bit which is masked by the memory address mask register (MAMRn) is not compared by the memory controller. The block address area size is determined by setting the memory address mask register. The set value in the register is compared with the block address area on the bus. If the compared result is a match, the memory controller sets the chip select signal ( CSn ) to "low". (i) Setting memory start address register The MS23 to MS16 bits of the memory start address register respectively correspond with addresses A23 to A16. The lower start address A15 to A0 are always set to address 0000H. Therefore the start address of the block address area are set to addresses 000000H to FF0000H every 64 Kbytes. (ii) Setting memory address mask registers The memory address mask register sets whether an address bit is compared or not. Set the register to "0" to compare, or to "1" not to compare. The address bit to be set is depended on the block address area. Block address area 0: A20 to A8 Block address area 1: A21 to A8 Block address area 2 to 3: A22 to A15 The above-mentioned bits are always compared. The block address area size is determined by the compared result. The size to be set depending on the block address area is as follows.
Size (bytes) CS Area
256
512
32 K
64 K
128 K
256 K
512 K
1M
2M
4M
8M
CS0 CS1 CS2 to CS3










Note: After reset release, only the control register of the block address area 2 is valid. The control register of the block address area 2 has bit. Setting bit to "0" sets the block address area 2 to addresses 000000H to FFFFFFH. Setting bit to "1" specifies the start address and the address area size as it is in the other block address area.
92C820-99
2007-02-16
TMP92C820
(iii) Example of register setting To set the block address area 512 bytes from address 110000H, set the register as follows. MSAR1 Register 7
Bit symbol Specified value M1S23 0
6
M1S22 0
5
M1S21 0
4
M1S20 1
3
M1S19 0
2
M1S18 0
1
M1S17 0
0
M1S16 1
M1S23 to M1S16 bits of the memory start address register MSAR1 correspond with address A23 to A16. A15 to A0 are set to "0". Therefore setting MSAR1 to the above-mentioned value specifies the start address of the block address area to address 110000H. The start address is set as it is in the other block address areas. MAMR1 Register 7
Bit symbol Specified value M1V21 0
6
M1V20 0
5
M1V19 0
4
M1V18 0
3
M1V17 0
2
M1V16 0
1
M1V15 to M1V9 0
0
M1V8 1
M1V21 to M1V16 and M1V8 bits of the memory address mask register MAMR1 set whether address A21 to A16 and A8 are compared or not. Set the register to "0" to compare, or to "1" not to compare. M1V15 to M1V9 bits set whether address A15 to A9 are compared or not with 1 bit. A23 and A22 are always compared. Setting the above-mentioned compares A23 to A9 with the values set as the start addresses. Therefore 512 bytes of addresses 110000H to 1101FFH are set as the block address area 1, and compared with the addresses on the bus. If the compared result is a match, the chip select signal CS1 is set to "low". The other block address area sizes are specified like this. Similarly, A23 is always compared in block address areas 2 to 3. Whether A22 to A15 are compared or not is set to register.
Note: When the set block address area overlaps with the built-in memory area, or both two address areas overlap, the block address area is processed according to priority as follows. Built-in I/O > Built-in memory > Block address area 0 > 1 > 2 > 3 > CSEX also that any accessed areas outside the address spaces set by CS0 to CS3 are processed as the CSEX space. Therefore, settings of CSEX apply for the control of wait cycles, data bus width, etc,.
92C820-100
2007-02-16
TMP92C820
(2) Connection memory specification Setting the BnOM1 to 0 bit of the control register (BnCSH) specifies the memory type to be connected with the block address areas. The interface signal is output according to the set memory as follows BnOM1, BnOM0 Bit (BnCSH register) BnOM1
0 0 1 1
BnOM0
0 1 0 1
Function
SRAM/ROM (Default) (Reserved) (Reserved) SDRAM
SDRAM is set only in block address are 1.
(3) Data bus width specification The data bus width is set for every block address area. The bus size is set by the BnBUS1 and BnBUS0 bits of the control register (BnCSH) as follows. BnBUS Bit (BnCSH register) BnBUS1
0 0 1 1
BnBUS0
0 1 0 1
Function
8-bit bus mode (Default) 16-bit bus mode 32-bit bus mode (Reserved)
This way of changing the data bus size depending on the address being accessed is called "dynamic bus sizing". The part where the data is output to is depended on the data size, the bus width and the start address.
Note:
Since there is a possibility of abnormal writing/reading of the data if two memories with different bus width are put in consecutive address, do not execute a access to both memories with one command.
92C820-101
2007-02-16
TMP92C820
Operand Data Size (Bit)
Operand Start Address 4n + 0 4n + 1
Memory Data Size (Bit) 8/16/32 8 16/32 8/16 32 8 16 32 8 16/32 8 16 32 8 16 32 8 16 32
CPU Address 4n + 0 4n + 1 4n + 1 4n + 2 4n + 2 4n + 3 4n + 3 4n + 3 (1) 4n + 0 (2) 4n + 1 4n + 0 (1) 4n + 1 (2) 4n + 2 (1) 4n + 1 (2) 4n + 2 4n + 1 (1) 4n + 2 (2) 4n + 1 4n + 2 4n + 2 (1) 4n + 3 (2) 4n + 4 (1) 4n + 3 (2) 4n + 4 (1) 4n + 3 (2) 4n + 4 (1) 4n + 0 (2) 4n + 1 (3) 4n + 2 (4) 4n + 3 (1) 4n + 0 (2) 4n + 2 4n + 0 (1) 4n + 0 (2) 4n + 1 (3) 4n + 2 (4) 4n + 3 (1) 4n + 1 (2) 4n + 2 (3) 4n + 4 (1) 4n + 1 (2) 4n + 4 (1) 4n + 2 (2) 4n + 3 (3) 4n + 4 (4) 4n + 5 (1) 4n + 2 (2) 4n + 4 (1) 4n + 2 (2) 4n + 4 (1) 4n + 3 (2) 4n + 4 (3) 4n + 5 (4) 4n + 6 (1) 4n + 3 (2) 4n + 4 (3) 4n + 6 (1) 4n + 3 (2) 4n + 4 D32 to D24 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b31 to b24 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b23 to b16 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b7 to b0 xxxxx
CPU Data
D23 to D16 xxxxx xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b23 to b16 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b31 to b24 D15 to D8 xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx b7 to b0 xxxxx b7 to b0 xxxxx xxxxx b15 to b8 xxxxx xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 b31 to b24 b15 to b8 xxxxx xxxxx xxxxx xxxxx b7 to b0 b23 to b16 xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 b31 to b24 xxxxx b31 to b24 xxxxx xxxxx xxxxx xxxxx b7 to b0 b23 to b16 xxxxx xxxxx b23 to b16 D7 to D0 b7 to b0 b7 to b0 xxxxx b7 to b0 xxxxx b7 to b0 xxxxx xxxxx b7 to b0 b15 to b8 b7 to b0 b7 to b0 b15 to b8 xxxxx b15 to b8 xxxxx b7 to b0 b15 to b8 b7 to b0 xxxxx b7 to b0 b15 to b8 xxxxx b15 to b8 xxxxx b15 to b8 b7 to b0 b15 to b8 b23 to b16 b31 to b24 b7 to b0 b23 to b16 b7 to b0 b7 to b0 b15 to b8 b23 to b16 b31 to b24 xxxxx b15 to b8 b31 to b24 xxxxx b31 to b24 b7 to b0 b15 to b8 b23 to b16 b31 to b24 b7 to b0 b23 to b16 xxxxx b23 to b16 b7 to b0 b15 to b8 b23 to b16 b31 to b24 xxxxx b15 to b8 b31 to b24 xxxxx b15 to b8
8
4n + 2 4n + 3
4n + 0
4n + 1
16
4n + 2
4n + 3
4n + 0
8
16 32 8
4n + 1
16
32 32 4n + 2 8
16 32 4n + 3 8
16
32
xxxxx: During a read, data input to the bus is ignored. At write, the bus is at high impedance and the write strobe signal remains to non active.
92C820-102
2007-02-16
TMP92C820
(4) Wait control The external bus cycle completes a wait of two states at least (100 ns at 20 MHz). Setting the BnWW2 to BnWW0 and BnWR2 to BnWR0 of the control register (BnCSL) specifies the number of waits in the read cycle and the write cycle. BnWW is set with the same method as BnWR. BnWW/BnWR Bit (BnCSL register) BnWW2 BnWR2
0 0 1 1 1 0
BnWW1 BnWR1
0 1 0 1 1 1 Others
BnWW0 BnWR0
1 0 1 0 1 1
Function
2states (0 waits) access fixed mode 3states (1 wait) access fixed mode (Default) 4states (2 waits) access fixed mode 5states (3 waits) access fixed mode 6states (4 waits) access fixed mode
WAIT pin input mode
(Reserved)
Note:
When SDRAM is specified as a connecting memory, setting should be 4 states (2 waits) in RD cycle and 3 states (1 wait) in WR cycle. (i) Waits number fixed mode The bus cycle is completed with the set states. The number of states is selected from 2 states (0 waits) to 5 states (3 waits). (ii) WAIT pin input mode This mode samples the WAIT input pins. It continuously samples the WAIT pin state and inserts a wait if the pin is active. The bus cycle is minimum 2 states. The bus cycle is completed when the wait signal is non active ("High" level) at 2 states. The bus cycle extends if the wait signal is active at 2 states and more.
(5) Insert recovery cycle If a lot of connected pertain ROM and etc. (Much data output floating time (tDF)), each other's data-bus-output-recovery-time is trouble. However, by setting BnREC of control register (BnCSH), can insert dummy cycle of 1 state just before first bus cycle of starting access another block address. BnREC Bit (BnCSH register)
0 1 No dummy cycle is inserted (Default). Dummy cycle is inserted.
Note:
When use MMU, built-in RAM type LCDD, this function cannot use.
92C820-103
2007-02-16
TMP92C820
* When not inserting a dummy cycle (0 waits)
SDCLK Address
CSm
CSn
RD
*
When inserting a dummy cycle (0 waits)
Dummy SDCLK Address
CSm
CSn
RD
(6) Basic bus timing * External read/write bus cycle (0 waits)
SDCLK (20 MHz)
CS
T1
T2
Address
RD
Read D31 to D0
WRxx
Input
Write Output
D31 to D0
*
External read/write bus cycle (1 wait)
SDCLK (20 MHz)
CS
T1
TW
T2
Address
RD
Read D31 to D0
WRxx
Input
Write D31 to D0 Output
92C820-104
2007-02-16
TMP92C820
* External read/write bus cycle (0 waits at WAIT pin input mode)
SDCLK (20 MHz)
CS
T1
T2
Address
RD
Read D31 to D0
WRxx
Input
Write D31 to D0
WAIT
Output
Sampling
*
External read/write bus cycle (n waits at WAIT pin input mode)
SDCLK (20 MHz)
CS
T1
TW
T2
Address
RD
Read D31 to D0
WRxx
Input
W D31 to D0
WAIT
Output
Sampling
Sampling
92C820-105
2007-02-16
TMP92C820
* Example of WAIT input cycle (5 waits)
FF0 D CK
RES
Q
FF1 D CK
RES
Q
FF2 D CK
RES
Q
FF3 D CK
RES
Q
FF4 D CK
RES
Q
WAIT
SDCLK
CSn RD WR
SDCLK (20 MHz)
CSn
1
2
3
4
5
6
7
RD
FF_RES FF0_D FF0_Q FF1_Q FF2_Q FF3_Q
WAIT
92C820-106
2007-02-16
TMP92C820 3.6.4 ROM Control (Page mode)
This section describes ROM page mode accessing and how to set registers. ROM page mode is set by the page ROM control register. (1) Operation and how to set the registers TMP92C820 supports ROM access of the page mode. The ROM access of the page mode is specified only in the block address area 2. ROM page mode is set by the page ROM control register (PMEMCR). Setting OPGE bit of the PMEMCR register to "1" sets the memory access of the block address area to ROM page mode access. The number of read cycles is set by the OPWR1 and OPWR0 bits of the PMEMCR register. OPWR1/OPWR0 Bit (PMEMCR register) OPWR1
0 0 1 1
OPWR0
0 1 0 1
Number of Cycle in a Page
1 state (n-1-1-1 mode) (n 2) 2 state (n-2-2-2 mode) (n 3) 3 state (n-3-3-3 mode) (n 4) (Reserved)
Note: Set the number of waits "n" to the control register (BnCSL) in each block address area.
The page size (the number of bytes) of ROM in the CPU size is set to the PR1 and 0 bit of the PMCME register. When data is read out until a border of the set page, the controller completes the page reading operation. The start data of the next page is read in the normal cycle. The following data is set to page read again. PR1/PR0 Bit (PMEMCR register) PR1
0 0 1 1
PR0
0 1 0 1 64 bytes 32 bytes
ROM Page Size
16 bytes (Default) 8 bytes
(2) Signal timing pulse
SDCLK tCYC A0~A23
CS2
+0
+1
+2
+3
tAD3
RD
tAD2
tAD2
tAD2
tHA
tRD3 D0~D31
Data input
tHA
Data input
tHA
Data input
tHA
Data input
tHR
92C820-107
2007-02-16
TMP92C820 3.6.5 List of Registers
The memory control registers and the settings are described as follows. For the addresses of the registers, see Section 5 "Table of Special Function Registers (SFRs)". (1) Control registers The control register is a pair of BnCSL and BnCSH. (n is a number of the block address area.) BnCSL has the same configuration regardless of the block address areas. In BnCSH, only B2CSH which is corresponded to the block address area 2 has a different configuration from the others. BnCSL 7
Bit symbol Read/Write After reset 0
6
BnWW2
5
BnWW1 W 1
4
BnWW0 0
3
2
BnWR2 0
1
BnWR1 W 1
0
BnWR0 0
BnWW<2:0> Specifies the number of write waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) BnWR<2:0> Specifies the number of read waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode
B2CSH 7
Bit symbol Read/Write After reset B2E: Enable bit 0 = No chip select signal output. 1 = Chip select signal output (Default). Note: After reset release, only the enable bit B2E of B2CS register is valid ("1"). B2M: Block address area specification 0 = Sets the block address area of CS2 to addresses 000000H to FFFFFFH (Default). 1 = Sets the block address area of CS2 to programmable. Note: After reset release, the block address area 2 is set to addresses 000000H to FFFFFFH. 1 B2E W 0 0 0
6
B2M
5
4
B2REC
3
B2OM1
2
B2OM0 W 0
1
B2BUS1 0/1
0
B2BUS0 0/1
92C820-108
2007-02-16
TMP92C820
B2REC: Sets the dummy cycle for data output recovery time. 0 = Not insert a dummy cycle (Default). 1 = Insert a dummy cycle. Note: When using MMU, LCD of built-in RAM type, this function cannot use. B2OM<1:0> 00 = SRAM or ROM (Default) Others = (Reserved) B2BUS<1:0> Sets the data bus width. 00 = 8 bits (Default) 01 = 16 bits 10 = 32 bits 11 = (Reserved) Note: The value of B2BUS bit is set according to the state of AM<1:0> pin after reset release.
BnCSH (n = 0, 1, 3) 7
Bit symbol Read/Write After reset BnE: Enable bit 0 = No chip select signal output (Default). 1 = Chip select signal output. Note: After reset release, only the enable bit B2E of B2CS register is valid ("1"). BnREC: Sets the dummy cycle for data output. 0 = Not insert a dummy cycle (Default). 1 = Insert a dummy cycle. Note: When using MMU, LCD of built-in RAM type, this function cannot use. BnOM<1:0> 00 = SRAM or ROM (Default) 01 = (Reserved) 10 = (Reserved) 11 = SDRAM Note: SDRAM is set only by B1CSH. BnBUS<1:0> Sets the data bus width. 00 = 8 bits (Default) 01 = 16 bits 10 = 32 bits 11 = (Reserved) BnE W 0 0 0
6
5
4
BnREC
3
BnOM1
2
BnOM0 W 0
1
BnBUS1 0
0
BnBUS0 0
92C820-109
2007-02-16
TMP92C820
BEXCSL 7
Bit symbol Read/Write After reset 0
6
BEXWW2
5
BEXWW1 W 1
4
BEXWW0 0
3
2
BEXWR2 0
1
BEXWR1 W 1
0
BEXWR0 0
BEXWW<2:0> specifies the number of write waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) BEXWR<2:0> Specifies the number of read waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode
BEXCSH 7
Bit symbol Read/Write After reset BEXOM<1:0> 00 = SRAM or ROM (Default) 01 = (Reserved) 10 = (Reserved) 11 = (Reserved) BEXBUS<1:0> Sets the data bus width. 00 = 8 bits (Default) 01 = 16 bits 10 = 32 bits 11 = (Reserved) 0 0
6
5
4
3
BEXOM1
2
BEXOM0 W
1
BEXBUS1 0
0
BEXBUS0 0
92C820-110
2007-02-16
TMP92C820
(2) Block address register A start address and an address area of the block address are specified by the memory start address register (MSARn) and the memory address mask register (MAMRn). The memory start address register sets all start address similarly regardless of the block address areas. The bit to be set by the memory address mask register is depended on the block address area. MSARn (n = 0 to 3) 7
Bit symbol Read/Write After reset 1 1 1 1 MnS23
6
MnS22
5
MnS21
4
MnS20 R/W
3
MnS19 1
2
MnS18 1
1
MnS17 1
0
MnS16 1
MnS<23:16> Sets a start address. Sets the start address of the block address areas. The bits are corresponding to the address A23 to A16.
MAMR0 7
Bit symbol Read/Write After reset M0V<20:8> Enables or masks comparison of the addresses. M0V20 to M0V8 are corresponding to addresses A20 to A8. The bits of M0V14 to M0V9 are corresponding to address A14 to A9 by 1 bit. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. 1 1 1 1 M0V20
6
M0V19
5
M0V18
4
M0V17 R/W
3
M0V16
2
M0V15
1
M0V14 to M0V9 1
0
M0V8
1
1
1
MAMR1 7
Bit symbol Read/Write After reset M1V<21:8> Enables or masks comparison of the addresses. M1V21 to M1V8 are corresponding to addresses A21 to A8. The bits of M1V15 to M1V9 are corresponding to address A15 to A9 by 1 bit. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. 1 1 1 1 M1V21
6
M1V20
5
M1V19
4
M1V18 R/W
3
M1V17
2
M1V16
1
M1V15 to M1V9 1
0
M1V8
1
1
1
MAMRn (n = 2 to 3) 7
Bit symbol Read/Write After reset MnV<22:15> Enables or masks comparison of the addresses. MnV22 to MnV15 are corresponding to addresses A22 to A15. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. 1 1 1 1 MnV22
6
MnV21
5
MnV20
4
MnV19 R/W
3
MnV18 1
2
MnV17 1
1
MnV16 1
0
MnV15 1
After a reset, MASR0 to MASR3 and MAMR0 to MAMR3 are set to "FFH". B0CSH, B1CSH, and B3CSH are reset to "0". This disabling the CS0, CS1, and CS3 areas. However, B2CSH is reset to "0" and B2CSH to "1", and CS2 is enabled 000000H to FFFFFFH. Also the bus width and number of waits specified in BEXCSH/L are used for accessing address except the specified CS0 to CS3 area.
92C820-111
2007-02-16
TMP92C820
(3) Page ROM control register (PMEMCR) The page ROM control register sets page ROM accessing. ROM page accessing is executed only in block address area 2. PMEMCR 7
Bit symbol Read/Write After reset OPGE enable bit 0 = No ROM page mode accessing (Default) 1 = ROM page mode accessing OPWR<1:0> Specifies the number of waits. 00 = 1 state (n-1-1-1 mode) (n 2) (Default) 01 = 2 states (n-2-2-2 mode) (n 3) 10 = 3 states (n-3-3-3 mode) (n 4) 11 = (Reserved) Note: Set the number of waits "n" to the control register (BnCSL) in each block address area. PR<1:0> ROM page size 00 = 64 bytes 01 = 32 bytes 10 = 16 bytes (Default) 11 = 8 bytes 0 0
6
5
4
OPGE
3
OPWR1
2
OPWR0 R/W 0
1
PR1 1
0
PR0 0
92C820-112
2007-02-16
TMP92C820
Table 3.6.1 Control Register 7
B0CSL (0140H) B0CSH (0141H) MAMR0 (0142H) MSAR0 (0143H) B1CSL (0144H) B1CSH (0145H) MAMR1 (0146H) MSAR1 (0147H) B2CSL (0148H) B2CSH (0149H) MAMR2 (014AH) MSAR2 (014BH) B3CSL (014CH) B3CSH (014DH) MAMR3 (014EH) MSAR3 (014FH) BEXCSH (0159H) BEXCSL (0158H) PMEMCR (0166H) Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset Bit symbol Read/Write After reset
6
B0WW2 0 - 0 (Note) M0V19 1 M0S22 1 B1WW2 0 - 0 (Note) M1V20 1 M1S22 1 B2WW2 0 B2M 0 M2V21 1 M2S22 1 B3WW2 0 - 0 (Note) M3V21 1 M3S22 1
5
B0WW1 W 1 - 0 (Note) M0V18 1 M0S21 1 B1WW1 W 1 - 0 (Note) M1V19 1 M1S21 1 B2WW1 W 1 - 0 (Note) M2V20 1 M2S21 1 B3WW1 W 1 - 0 (Note) M3V20 1 M3S21 1
4
B0WW0 0 B0REC W 0 M0V17 R/W 1 M0S20 R/W 1 B1WW0 0 B1REC W 0 M1V18 R/W 1 M1S20 R/W 1 B2WW0 0 B2REC W 0 M2V19 R/W 1 M2S20 R/W 1 B3WW0 0 B3REC W 0 M3V19 R/W 1 M3S20 R/W 1
3
2
B0WR2 0 B0OM0 0 M0V15 1 M0S18 1 B1WR2 0 B1OM0 0 M1V16 1 M1S18 1 B2WR2 0 B2OM0 0 M2V17 1 M2S18 1 B3WR2 0 B3OM0 0 M3V17 1 M3S18 1 BEXOM0 W 0 BEXWR2 0 OPWR0 R/W 0
1
B0WR1 W 1 B0BUS1 0/1 M0V14-V9 1 M0S17 1 B1WR1 W 1 B1BUS1 0/1 M1V15-V9 1 M1S17 1 B2WR1 W 1 B2BUS1 0/1 M2V16 1 M2S17 1 B3WR1 W 1 B3BUS1 0/1 M3V16 1 M3S17 1 BEXBUS1 0 BEXWR1 W 1 PR1 1
0
B0WR0 0 B0BUS0 0/1 M0V8 1 M0S16 1 B1WR0 0 B1BUS0 0/1 M1V8 1 M1S16 1 B2WR0 0 B2BUS0 0/1 M2V15 1 M2S16 1 B3WR0 0 B3BUS0 0/1 M3V15 1 M3S16 1 BEXBUS0 0 BEXWR0 0 PR0 0
B0E 0 M0V20 1 M0S23 1
B0OM1 0 M0V16 1 M0S19 1
B1E 0 M1V21 1 M1S23 1
B1OM1 0 M1V17 1 M1S19 1
B2E 1 M2V22 1 M2S23 1
B2OM1 0 M2V18 1 M2S19 1
B3E 0 M3V22 1 M3S23 1
B3OM1 0 M3V18 1 M3S19 1 BEXOM1 0
BEXWW2 0
BEXWW1 W 1
BEXWW0 0 OPGE 0
OPWR1 0
Note: Always write "0".
92C820-113
2007-02-16
TMP92C820 3.6.6 Cautions
(1) Note on timing between CS and RD If the parasitic capacitance of the read signal (Output enable signal) is greater than that of the chip select signal, it is possible that an unintended read cycle occurs due to a delay in the read signal. Such an unintended read cycle may cause a trouble as in the case of (a) in Figure 3.6.1
0H
SDCLK (20 MHz) Address MEMORY 1CS MEMORY 2CS
RD
(a)
Figure 3.6.1 Read Signal Delay Read Cycle Example: When using an externally connected flash EEPROM which users JEDEC standard commands, note that the toggle bit may not be read out correctly. If the read signal in the cycle immediately preceding the access to the flash EEPROM does not go high in time, as shown in Figure 3.6.2 an unintended read cycle like the one shown in (b) may occur.
1H
Memory access SDCLK (20 MHz) Address Flash EEPROM Chip select Read Toggle bit (b)
Toggle bit RD cycle 1
Figure 3.6.2 Flash EEPROM Toggle Bit Read Cycle When the toggle bit reverse with this unexpected read cycle, TMP92C820 always reads same value of the toggle bit, and cannot read the toggle bit correctly. To avoid this phenomena, the data polling control recommended.
92C820-114
2007-02-16
TMP92C820
(2) The cautions at the time of the functional change of a
CSn .
A chip select signal output has the case of a combination terminal with a general-purpose port function. In this case, an output latch register and a function control register are initialized by the reset action, and an object terminal is initialized by the port output ("1" or "0") by it. Functional change Although an object terminal is changed from a port to a chip select signal output by setting up a function control register (PnFC register), the short pulse for several ns may be outputted to the changing timing. Although it does not become especially a problem when using the usual memory, it may become a problem when using a special memory.
* XX is a function register address.(When an output port is initialized by "0") A port is set as CSn . Internal Signal Internal address bus Function control signal Output port External Signal Pxx A23 to A0 n n+2 Output pulse tAD3
CSn
n
XX
n+2
The measure by software The countermeasures in S/W for avoiding this phenomenon are explained. Since CS signal decodes the address of the access area and is generated, an unnecessary pulse is outputted by access to the object CS area immediately after setting it as a CSn function. Then, if internal area is accessed also immediately after setting a port as CS function, an unnecessary pulse will not output. 1. The ban on interruption under functional change (DI command) 2. 3. A dummy command is added in order to carry out continuous internal access. (Access to a functional change register is corresponded by 16-bit command. (LDW command))
A port is set as CSn . Internal Internal address bus Function control signal Output port External signal Pxx A23 to A0 n n+2
CSn
Dummy access n+2
signal
XX
XX+1
92C820-115
2007-02-16
TMP92C820
3.7
8-Bit Timers (TMRA)
The TMP92C820 features 4 built-in 8-bit timers. These timers are paired into four modules: TMRA01 and TMRA23. Each module consists of two channels and can operate in any of the following four operating modes. * * * *
0H
8-bit interval timer mode 16-bit interval timer mode 8-bit programmable square wave pulse generation output mode (PPG: Variable duty cycle with variable period) 8-bit pulse width modulation output mode (PWM: Variable duty cycle with constant period)
1H
Figure 3.7.1 to Figure 3.7.2 Show block diagrams for TMRA01 and TMRA23. Each channel consists of an 8-bit up counter, an 8-bit comparator and an 8-bit timer register. In addition, a timer flip-flop and a prescaler are provided for each pair of channels. The operation mode and timer flip-flops are controlled by five controls SFR (Special function register). Each of the two modules (TMRA01 and TMRA23) can be operated independently. All modules operate in the same manner; hence only the operation of TMRA01 is explained here. The contents of this chapter are as follows. 3.7.1 3.7.2 3.7.3 3.7.4 Block Diagrams Operation of Each Circuit SFRs Operation in Each Mode
(1) 8-bit timer mode (2) 16-bit timer mode (3) 8-bit PPG (Programmable pulse generation) output mode (4) 8-bit PWM output mode (5) Mode setting
Table 3.7.1 Registers and Pins for Each Module Module TMRA01
TA0IN Input pin for external clock (shared with PC0) Output pin for timer flip-flop Timer run register SFR (Address) Timer register Timer mode register Timer flip-flop control register TA1OUT (shared with PC1) TA01RUN (1100H) TA0REG (1102H) TA1REG (1103H) TA01MOD (1104H) TA1FFCR (1105H) No TA3OUT (Shared with PC5) TA23RUN (1108H) TA2REG (110AH) TA3REG (110BH) TA23MOD (110CH) TA3FFCR (110DH)
TMRA23
External pin
92C820-116
2007-02-16
3.7.1
Prescaler Run/clear TA01RUN
Prescaler clock: T0 T16 Timer flip-flop TA1FF TA01RUN TA01RUN Selector TA1FFCR 8-bit up counter (UC1) 8-bit up counter (UC0) 2
overflow
n
2 T256
4
8
16 32 64 128 256 512
T1
T4
Block Diagrams
Timer flip-flop output: TA1OUT
Selector T1 T16 T256 TA01MOD
External input clock: TA0IN
T1 T4 T16
Figure 3.7.1 TMRA01 Block Diagram
TA01MOD
92C820-117
8-bit comparator (CP0) TA01MOD 8-bit timer register TA0REG Match detect
TA0TRG
TA01MOD
8-bit comparator (CP1)
Match detect
8-bit timer register TA1REG
TA01RUN Register buffer 0
TMP92C820
2007-02-16
Internal data bus
TMRA0 interrupt output: INTTA0
Internal data bus TMRA0 match output: TA0TRG
TMRA1 interrupt output: INTTA1
Prescaler 8 T16 Timer flip-flop TA3FF TA23RUN TA23RUN Selector TA3FFCR 8-bit up counter (UC3) 8-bit up counter (UC2) 2 overflow TA23MOD TA23MOD
n
Prescaler clock: T0 16 32 64 128 256 512 T256 TA23RUN
2
4
Run/clear
T1
T4
Timer flip-flop output: TA3OUT (Supply to LCDC)
Selector T1 T16 T256
T1 T4 T16
Figure 3.7.2 TMRA23 Block Diagram
92C820-118
8-bit comparator (CP2) TA23MOD 8-bit timer register TA2REG Match detect TA2TRG Register buffer 2 Internal data bus TMRA2 interrupt output: INTTA2
TA23MOD
8-bit comparator register (CP3)
Match detect
8-bit timer register TA3REG
TA23RUN
TMP92C820
2007-02-16
Internal data bus TMRA2 match output: TA2TRG
TMRA3 interrupt output: INTTA3
TMP92C820 3.7.2 Operation of Each Circuit
(1) Prescalers A 9-bit prescaler generates the input clock to TMRA01. The clock T0 is divided into 8 by the CPU clock fSYS and input to this prescaler. The prescaler operation can be controlled using TA01RUN in the timer control register. Setting to "1" starts the count; setting to "0" clears the prescaler to 0 and stops operation. Table 3.7.2 shows the various prescaler output clock resolutions.
2H
Table 3.7.2 Prescaler Output Clock Resolution
Clock gear selection SYSCR1 - 000 (1/1) 001 (1/2) 010 (1/4) 011 (1/8) 100 (1/16) 0 (fc) 1/8 System clock selection SYSCR1 1 (fs)
- T1(1/2)
fs/16 fc/16 fc/32 fc/64 fc/128 fc/256
Timer counter input clock TMRA prescaler TAxMOD T4(1/8) T16(1/32) T256(1/512)
fs/64 fc/64 fc/128 fc/256 fc/512 fc/1024 fs/256 fc/256 fc/512 fc/1024 fc/2048 fc/4096 fs/4096 fc/4096 fc/8192 fc/16384 fc/32768 fc/65536
(2) Up counters (UC0 and UC1) These are 8-bit binary counters which count up the input clock pulses for the clock specified by TA01MOD. The input clock for UC0 is selectable and can be either the external clock input via the TA0IN pin or one of the three internal clocks T1, T4 or T16. The clock setting is specified by the value set in TA01MOD. The input clock for UC1 depends on the operation mode. In 16-bit timer mode, the overflow output from UC0 is used as the input clock. In any mode other than 16-bit timer mode, the input clock is selectable and can either be one of the internal clocks T1, T16, or T256, or the comparator output (The match detection signal) from TMRA0. For each interval timer the timer operation control register bits TA01RUN and TA01RUN can be used to stop and clear the up counters and to control their count. A reset clears both up counters, stopping the timers.
92C820-119
2007-02-16
TMP92C820
(3) Timer registers (TA0REG and TA1REG) These are 8-bit registers, which can be used to set a time interval. When the value set in the timer register TA0REG or TA1REG matches the value in the corresponding up counter, the comparator match detect signal goes active. If the value set in the timer register is 00H, the signal goes active when the up counter overflows. The TA0REG are double buffer structure, each of which makes a pair with register buffer. The setting of the bit TA01RUN determines whether TA0REG's double buffer structure is enabled or disabled. It is disabled if = "0" and enabled if = "1". When the double buffer is enabled, data is transferred from the register buffer to the timer register when a 2n overflow occurs in PWM mode, or at the start of the PPG cycle in PPG mode. Hence the double buffer cannot be used in timer mode. A reset initializes to "0", disabling the double buffer. To use the double buffer, write data to the timer register, set to "1", and write the following data to the register buffer Figure 3.7.3 show the configuration of TA0REG.
3H
Timer registers 0 (TA0REG) B Shift trigger Register buffers 0 Selector S A Write to TA0REG Matching detection in PPG cycle n 2 overflow of PWM
Write Internal data bus TA01RUN
Figure 3.7.3 Configuration of TA0REG Note: The same memory address is allocated to the timer register and the register buffer. When = 0, the same value is written to the register buffer and the timer register; when = 1, only the register buffer is written to. The address of each timer register is as follows. TA0REG: 001102H TA2REG: 00110AH TA1REG: 001103H TA3REG: 00110BH
All these registers are write-only and cannot be read.
92C820-120
2007-02-16
TMP92C820
(4) Comparator (CP0) The comparator compares the value in an up counter with the value set in a timer register. If they match, the up counter is cleared to zero and an interrupt signal (INTTA0 or INTTA1) is generated. If timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time. (5) Timer flip-flop (TA1FF) The timer flip-flop (TA1FF) is a flip-flop inverted by the match detects signal (8-bit comparator output) of each interval timer. Whether inversion is enabled or disabled is determined by the setting of the bit TA1FFCR in the timer flip-flops control register. A reset clears the value of TA1FF to "0". Writing "01" or "10" to TA1FFCR sets TA1FF to 0 or 1. Writing "00" to these bits inverts the value of TA1FF (this is known as software inversion). The TA1FF signal is output via the TA1OUT pin (which can also be used as PC1). When this pin is used as the timer output, the timer flip-flop should be set beforehand using the port C function register PCFC.
Note: When the double buffer is enabled for an 8-bit timer in PWM or PPG mode, caution is required as explained below. If new data is written to the register buffer immediately before an overflow occurs by a match between the timer register value and the up-counter value, the timer flip-flop may output an unexpected value. For this reason, make sure that in PWM mode new data is written to the register buffer by six cycles (fSYS x 6) before the next overflow occurs by using an overflow interrupt. When using PPG mode, make sure that new data is written to the register buffer by six cycles before the next cycle compare match occurs by using a cycle compare match interrupt. Example when using PWM mode
Match between TA0REG and up-counter 2 overflow interrupt (INTTA0) TA1OUT tPWM (PWM cycle)
n
Desired PWM cycle change point Write new data to the register buffer before the next overflow occurs by using an overflow interrupt
92C820-121
2007-02-16
TMP92C820 3.7.3 SFRs
TMRA01 Run Register 7
TA01RUN (1100H) Bit symbol Read/Write After reset Function TA0RDE R/W 0 Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA01 R/W 0 IDLE2 0: Stop 1: Operate
2
TA01PRUN 0 TMRA01 prescaler
1
TA1RUN R/W 0 UP counter (UC1)
0
TA0RUN 0 UP counter (UC0)
0: Stop and clear 1: Run (Count up)
Timer run/stop control 0 1 0 1 Stop and clear Run (Count up) Disable Enable
TA0REG double buffer control
Note: The values of bits 4 to 6 of TA01RUN are undefined when read.
TMRA23 Run Register 7
TA23RUN (1108H) Bit symbol Read/Write After reset Function TA2RDE R/W 0 Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA23 R/W 0 IDLE2 0: Stop 1: Operate
2
TA23PRUN
1
TA3RUN R/W 0 UP counter (UC3)
0
TA2RUN 0 UP counter (UC4)
0 TMRA23 prescaler
0: Stop and clear 1: Run (Count up)
Timer run/stop control 0 1 0 1 Stop and clear Run (Count up) Disable Enable
TA2REG double buffer control
Note: The values of bits 4 to 6 of TA23RUN are undefined when read.
Figure 3.7.4 TMRA Registers (1)
92C820-122
2007-02-16
TMP92C820
TMRA01 Mode Register 7
TA01MOD Bit symbol (1104H) Read/Write After reset Function TA01M1 0 Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
6
TA01M0 0
5
PWM01 0 PWM cycle 00: Reserved 01: 2
6 7 8
4
PWM00 0 R/W
3
TA1CLK1 0 00: TA0TRG 01: T1 10: T16 11: T256
2
TA1CLK0 0
1
TA0CLK1 0
0
TA0CLK0 0
Source clock for TMRA1
Source clock for TMRA0
00: TA0IN pin (Note) 01: T1 10: T4 11: T16
10: 2 11: 2
TMRA0 source clock selection 00 01 10 11 TA0IN (External input) T1 T4 T16 TA01MOD = 01
Overflow output from TMRA0
TMRA1 source clock selection TA01MOD 01 00 01 10 11 00 01 10 11 00 01 10 11
Comparator output from TMRA0
T1 T16 T256 Reserved 2 x Source clock
6 7 8
(16-bit timer mode)
PWM cycle selection
2 x Source clock 2 x Source clock Two 8-bit timers 16-bit timer 8-bit PPG 8-bit PWM (TMRA0) + 8-bit timer (TMRA1)
TMRA01 operation mode selection
Note: When set TA0IN pin, must set TA01MOD after set port C.
Figure 3.7.5 TMRA Registers (2)
92C820-123
2007-02-16
TMP92C820
TMRA23 Mode Register 7
TA23MOD Bit symbol (110CH) Read/Write After reset Function TA23M1 0 Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
6
TA23M0 0
5
PWM21 0 PWM cycle 00: Reserved 01: 2
6 7 8
4
PWM20 0 R/W
3
TA3CLK1 0 00: TA2TRG 01: T1 10: T16 11: T256
2
TA3CLK0 0
1
TA2CLK1 0 00: Reserved 01: T1 10: T4 11: T16
0
TA2CLK0 0
TMRA3 clock for TMRA3
TMRA2 clock for TMRA2
10: 2 11: 2
TMRA2 source clock selection 00 01 10 11 Do not set T1 T4 T16 TA23MOD = 01
Overflow output from TMRA2
TMRA3 source clock selection TA23MOD 01 00 01 10 11 00 01 10 11 00 01 10 11
Comparator output from TMRA2
T1 T16 T256 Reserved 2 x Source clock
6 7 8
(16-bit timer mode)
PWM cycle selection
2 x Source clock 2 x Source clock Two 8-bit timers 16-bit timer 8-bit PPG 8-bit PWM (TMRA2) + 8-bit timer (TMRA3)
TMRA23 operation mode selection
Figure 3.7.6 TMRA Registers (3)
92C820-124
2007-02-16
TMP92C820
TMRA1 Flip-Flop Control Register 7
TA1FFCR (1105H) Bit symbol Read/Write 1 00: Invert TA1FF 01: Set TA1FF 10: Clear TA1FF 11: Don't care
6
5
4
3
TA1FFC1 R/W
2
TA1FFC0 1
1
TA1FFIE R/W 0 TA1FF control for inversion 0: Disable 1: Enable
0
TA1FFIS 0 TA1FF1 inversion select 0: TMRA0 1: TMRA1
Read-modify After reset -write instructions Function are prohibited.
Inverse signal for timer flop-flop 1 (TA1FF) (Don't care except in 8-bit timer mode) 0 1 0 1 00 01 10 11 Note: The values of bits 4 to 7 of TA1FFCR are undefined when read. Inversion by TMRA0 Inversion by TMRA1 Disabled Enabled Inverts the value of TA1FF Sets TA1FF to "1" Clears TA1FF to "0" Don't care
Inversion of TA1FF
Control of TA1FF
Figure 3.7.7 TMRA Registers (4)
92C820-125
2007-02-16
TMP92C820
TMRA3 Flip-Flop Control Register 7
TA3FFCR (110DH) Bit symbol Read/Write 1 00: Invert TA3FF 01: Set TA3FF 10: Clear TA3FF 11: Don't care
6
5
4
3
TA3FFC1 R/W
2
TA3FFC0 1
1
TA3FFIE R/W 0 TA3FF control for inversion 0: Disable 1: Enable
0
TA3FFIS 0 TA3FF inversion select 0: TMRA2 1: TMRA3
Read-modify After reset -write instructions Function are prohibited.
Inverse signal for timer flip-flop 3 (TA3FF) (Don't care except in 8-bit timer mode) 0 1 0 1 00 01 10 11 Note: The values of bits 4 to 7 of TA3FFCR are undefined when read. Inversion by TMRA2 Inversion by TMRA3 Disabled Enabled Inverts the value of TA3FF Sets TA3FF to "1" Clears TA3FF to "0" Don't care
Inversion of TA3FF
Control of TA3FF
Figure 3.7.8 TMRA Register
92C820-126
2007-02-16
TMP92C820
TMRA Register (TA0REG to TA3REG) Symbol
TA0REG
Address
1102H
7
6
5
4
- W Undefined -
3
2
1
0
TA1REG
1103H
W Undefined -
TA2REG
110AH
W Undefined -
TA3REG
110BH
W Undefined
Note: Read-modify-write instruction is prohibited for above registers.
Figure 3.7.9 Register for 8-Bit Timers
92C820-127
2007-02-16
TMP92C820 3.7.4 Operation in Each Mode
(1) 8-bit timer mode Both timer 0 and timer 1 can be used independently as 8-bit interval timers. 1. Generating interrupts at a fixed interval (using TMRA1) To generate interrupts at constant intervals using timer 1 (INTTA1), first stop TMRA1 then set the operation mode, input clock and a cycle to TA01MOD and TA1REG register, respectively. Then, enable the interrupt INTTA1 and start TMRA1 counting.
Example: To generate an INTTA1 interrupt every 40 s at fC = 40 MHz, set each register as follows: MSB 7 TA01RUN TA01MOD TA1REG INTETA01 TA01RUN 0 0 6 0 1 5 - 1 0 4 - 0 1 3 0 0 - 2 - 1 1 - 1 1 0 - 0 - 1 0 - - 0 - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (=(16/fc)s at fC = 40 MHz) as the input clock. Set TA1REG to 40 s / T1 = 100 = 64H Enable INTTA1 and set it to level 5. Start TMRA1 counting. - X X X - LSB
X 1
- X X X -
X: Don't care, -: No change
Select the input clock using Table 3.7.3
4H
Table 3.7.3 Selecting Interrupt Interval and the Input Clock Using 8-Bit Timer Input Clock
T1 (8/fSYS) T4 (32/fSYS) T16 (128/fSYS) T256 (2048/fSYS)
Interrupt Interval (at fSYS = 20 MHz)
0.4 s to 102.4 s 1.6 s to 409.6 s 6.4 s to 1.638 ms 102.4 s to 26.21 ms
Resolution
0.4 s 1.6 s 6.4 s 102.4 s
Note: The input clocks for TMRA0 and TMRA1 differ as follows: TMRA0: Uses TMRA0 input (TA0IN) and can be selected from T1, T4, or T16 TMRA1: Match output of TMRA0 (TA0TRG) and can be selected from T1, T16, T256
92C820-128
2007-02-16
TMP92C820
2. Generating a 50% duty ratio square wave pulse The state of the timer flip-flop (TA1FF1) is inverted at constant intervals and its status output via the timer output pin (TA1OUT).
Example: To output a 2.4 s square wave pulse from the TA1OUT pin at fC = 40 MHz, use the following procedure to make the appropriate register settings. This example uses timer 1; however, either timer 0 or timer 1 may be used. 7 TA01RUN TA01MOD TA1REG TA1FFCR PCCR PCFC TA01RUN 0 0 6 0 0 5 - 0 4 - 0 3 0 0 2 - 1 0 0 1 0 - 1 1 0 - - 1 1 - - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (=(16/fc)s at fC = 40 MHz) as the input clock. Set the timer register to 2.4 s / T1 / 2 = 3 Clear TA1FF to 0 and set it to invert on the match detect signal from timer 1. Set PC1 to function as the TA1OUT pin. Start TMRA1 counting.
- X X X -
X X X X 1 X - X -
-X-X1 -X-X1 1 1
- X X X -
X: Don't care, -: No change
T1 TA01RUN Bit7 to 2 Up counter Bit1 Bit0 Comparator timing Comparator output (Match detect) INTTA1 UC1 Clear TA1FF TA1OUT 1.2 s at fC = 40 MHz 0 1 2 3 0 1 2 3 0 1 2 3 0
Figure 3.7.10 Square Wave Output Timing Chart (50% duty)
92C820-129
2007-02-16
TMP92C820
3. Making TMRA1 count up on the match signal from the TMRA0 comparator Select 8-bit timer mode and set the comparator output from TMRA0 to be the input clock to TMRA1.
Comparator output (Timer 0 match) Timer 0 up counter (when TA0REG = 5) Timer 1 up counter (when TA1REG = 2) Timer 1 match output 1 2 3 1 4 5 1 2 3 2 4 5 1 2 1 3
Figure 3.7.11 TMRA1 Count Up on Signal from TMRA0 (2) 16-bit timer mode A 16-bit interval timer is configured by pairing the two 8-bit timers TMRA0 and TMRA1. To make a 16-bit interval timer in which TMRA0 and TMRA1 are cascaded together, set TA01MOD to 01. In 16-bit timer mode, the overflow output from TMRA0 is used as the input clock for TMRA1, regardless of the value set in TA01MOD. Table 3.7.4 shows the relationship between the timer (Interrupt) cycle and the input clock selection.
5H
To set the timer interrupt interval, set the lower eight bits in timer register TA0REG and the upper eight bits in TA1REG. Be sure to set TA0REG first (as entering data in TA0REG temporarily disables the compare, while entering data in TA1REG starts the compare).
Example: To generate an INTTA1 interrupt every 0.4 s at fC = 40 MHz, set the timer registers TA0REG and TA1REG as follows: If T16 (=(256/fc)s at fSYS = 20 MHz) is used as the input clock for counting, set the following value in the registers: 0.4 s /=(256/fc)s = 62500 = F424H; e.g., set TA1REG to F4H and TA0REG to 24H.
92C820-130
2007-02-16
TMP92C820
The comparator match signal is output from TMRA0 each time the up counter UC0 matches TA0REG, though the up counter UC0 is not be cleared. In the case of the TMRA1 comparator, the match detect signal is output on each comparator pulse on which the values in the up counter UC1 and TA1REG match. When the match detect signal is output simultaneously from both the comparator TMRA0 and TMRA1, the up counters UC0 and UC1 are cleared to 0 and the interrupt INTTA1 is generated. Also, if inversion is enabled, the value of the timer flip-flop TA1FF is inverted.
Example: When TA1REG = 04H and TA0REG = 80H Value of up counter (UC1, UC0) TMRA0 comparator match detect signal TMRA1 comparator match detect signal Interrupt INTTA0 Interrupt INTTA1 Timer output TA1OUT Inversion
0080H
0180H
0280H
0380H
0480H
0080H
Figure 3.7.12 Timer Output by 16-Bit Timer Mode
(3) 8-bit PPG (Programmable pulse generation) output mode Square wave pulses can be generated at any frequency and duty ratio by TMRA0. The output pulses may be active low or active high. In this mode TMRA1 cannot be used. TMRA0 outputs pulses on the TA1OUT pin (which can also be used as PC1).
tH = "10" t tL = "01" t Example: = "01" TA0REG and UC0 match (Interrupt INTTA0) TA1REG and UC0 match (Interrupt INTTA1) TA1OUT TA0REG TA1REG tH tL
Figure 3.7.13 8-Bit PPG Output Waveforms
92C820-131
2007-02-16
TMP92C820
In this mode a programmable square wave is generated by inverting the timer output each time the 8-bit up counter (UC0) matches the value in one of the timer registers TA0REG or TA1REG. The value set in TA0REG must be smaller than the value set in TA1REG. Although the up counter for TMRA1 (UC1) is not used in this mode, TA01RUN should be set to "1" so that UC1 is set for counting. Figure 3.7.14 shows a block diagram representing this mode.
6H
TA01RUN Selector TA0IN T1 T4 T16 TA01MOD 8-bit up counter (UC0)
TA1OUT TA1FFCR
TA1FF
Inversion INTTA0
Comparator
Comparator
INTTA1
Selector
TA0REG Shift trigger
TA0REG-WR TA01RUN Register buffer TA1REG
Internal data bus
Figure 3.7.14 Block Diagram of 8-Bit PPG Output Mode If the TA0REG double buffer is enabled in this mode, the value of the register buffer will be shifted into TA0REG each time TA1REG matches UC0. Use of the double buffer facilitates the handling of low duty waves (when duty is varied).
Match with TA0REG and up counter (Up counter = Q1) Match with TA1REG TA0REG (Value to be compared) Register buffer Shift from register buffer Q1 Q2 Q2 Q3 TA0REG (Register buffer) write (Up countner = Q2)
Figure 3.7.15 Operation of Register Buffer
92C820-132
2007-02-16
TMP92C820
Example: To generate 1/4 duty 62.5 kHz pulses (at fC = 40 MHz):
16 s Calculate the value which should be set in the timer register. To obtain a frequency of 62.5 kHz, the pulse cycle t should be: t = 1/62.5 kHz = 16 s T1 (=(16/fc)) (at fC = 40 MHz); 16 s /(16/fc)s = 40 Therefore set TA1REG to 40 (28H) The duty is to be set to 1/4: t x 1/4 = 16 s x 1/4 = 4 s 4 s / (16/fc)s = 10 Therefore, set TA0REG = 10 = 0AH. 7 TA01RUN TA01MOD TA0REG TA1REG TA1FFCR PCCR PCFC TA01RUN 1 0 0 6 0 0 0 5 - 0 1 4 - 0 0 3 - 1 1 2 0 - 0 0 1 1 0 0 1 0 1 0 0 1 0 0 - - - 1 Stop TMRA0 and TMRA1 and clear it to "0". Set the 8-bit PPG mode, and select T1 as input clock. Write 0AH Write 28H Set TA1FF, enabling both inversion and the double buffer. 10 generates a negative logic pulse. Set PC1 as the TA1OUT pin. Start TMRA0 and TMRA1 counting.
0 X X X -
X X X X 0 X - X -
-X-X1 -X-X1 1 1
1 X X X -
X: Don't care, -: No change
92C820-133
2007-02-16
TMP92C820
(4) 8-bit PWM output mode This mode is only valid for TMRA0. In this mode, a PWM pulse with the maximum resolution of 8 bits can be output. When TMRA0 is used the PWM pulse is output on the TA1OUT pin (which is also used as PC1). TMRA1 can also be used as an 8-bit timer. The timer output is inverted when the up counter (UC0) matches the value set in the timer register TA0REG or when 2n counter overflow occurs (n = 6, 7 or 8 as specified by TA01MOD). The up counter UC0 is cleared when 2n counter overflow occurs. The following conditions must be satisfied before this PWM mode can be used. Value set in TA0REG < Value set for 2n counter overflow Value set in TA0REG 0
TA0REG and UC0 match 2 overflow (INTTA0 interrupt)
n
TA1OUT tPWM (PWM cycle)
Figure 3.7.16 8-Bit PWM Waveforms Figure 3.7.17 shows a block diagram representing this mode.
7H
TA01RUN TA0IN T1 T4 T16 8-bit up counter (UC0)
TA1OUT
Selector
Clear
TAFF1 Invert
TA1FFCR
TA01MOD
2 overflow control Overflow
n
TA01MOD
Comparator
INTTA0 TA0REG Selector TA0REG-WR TA01RUN Register buffer Shift trigger
Internal data bus
Figure 3.7.17 Block Diagram of 8-Bit PWM Mode
92C820-134
2007-02-16
TMP92C820
In this mode the value of the register buffer will be shifted into TA0REG if 2n overflow is detected when the TA0REG double buffer is enabled. Use of the double buffer facilitates the handling of low duty ratio waves.
Match with TA0REG Up counter = Q1 2 overflow Shift into TA0REG TA0REG (Value to be compared) Register buffer Q1 Q2 Q2 Q3 TA0REG (Register buffer) write
n
Up counter = Q2
Figure 3.7.18 Register Buffer Operation
Example: To output the following PWM waves on the TA1OUT pin at fC = 40 MHz:
36.0 s 51.2 s To achieve a 51.2 s PWM cycle by setting T1 to 0.4 s (at fC = 40 MHz): 51.2 s / (16/fc)s = 128 n 2 = 128 Therefore n should be set to 7. Since the low-level period is 36.0 s when T1 = (16/fc) s, set the following value for TREG0: 36.0 s /(16/fc)s = 90 = 5AH MSB 7 TA01RUN TA01MOD TA0REG TA1FFCR PCCR PCFC TA01RUN 1 0 6 1 1 5 1 0 4 0 1 3 - 1 2 - - 0 0 1 - 0 1 1 0 0 1 0 - - - 1 Stop TMRA0 and clear it to 0. Select 8-bit PWM mode (Cycle: 2 ) and select T1 as the input clock.
7
LSB
- X X X -
Write 5AH. Clear TA1FF to 0, enable the inversion and double buffer. Set PC1 and the TA1OUT pin. Start TMRA0 counting.
X X X X 1 X - X -
-X-X1 -X-X1 1 -
1 X X X -
X: Don't care, -: No change
92C820-135
2007-02-16
TMP92C820
Table 3.7.4 PWM Cycle
PWM cycle
Clock gear SYSCR1 System clock SYSCR0
TAxxMOD - T1(x2) 2 (x64) TAxxMOD T4(x8)
4096/fs 4096/fc 8192/fc 16384/fc 32768/fc 65536/fc
6
2 (x128) TAxxMOD T1(x2)
2048/fs 2048/fc 4096/fc 8192/fc 16384/fc 32768/fc
7
2 (x256) TAxxMOD T1(x2)
4096/fs 4096/fc 8192/fc 16384/fc 32768/fc 65536/fc
8
T16(x32)
16384/fs 16384/fc 32768/fc 65536/fc 131072/fc 262144/fc
T4(x8)
8192/fs 8192/fc 16384/fc 32768/fc 65536/fc 131072/fc
T16(x32)
32768/fs 32768/fc 65536/fc 131072/fc 262144/fc 524288/fc
T4(x8)
16384/fs 16384/fc 32768/fc 65536/fc 131072/fc 262144/fc
T16(x32)
65536/fs 65536/fc 131072/fc 262144/fc 524288/fc 1048576/fc
- 000(x1) 001(x2) 010(x4) 011(x8) 100(x16)
1(fs)
1024/fs 1024/fc
0(fc)
x8
2048/fc 4096/fc 8192/fc 16384/fc
(5) Mode setting Table 3.7.5 shows the SFR settings for each mode.
8H
Table 3.7.5 Timer Mode Setting Registers Register Name Function Timer Mode TA01MOD PWM Cycle Upper Timer Input Clock
Lower timer match, T1, T16, T256 (00, 01, 10, 11) -
TA1FFCR Timer F/F Invert Signal Select
0: Lower timer output 1: Upper timer output
Lower Timer Input Clock
External clock, T1, T4, T16 (00, 01, 10, 11) External clock,
8-bit timer x 2 channels
00
-
16-bit timer mode
01
-
T1, T4, T16 (00, 01, 10, 11) External clock, T1, T4, T16 (00, 01, 10, 11) External clock, T1, T4, T16 (00, 01, 10, 11) -
-
8-bit PPG x 1 channel
10
-
-
-
8-bit PWM x 1 channel 8-bit timer x 1 channel
11
2,2,2 (01, 10, 11) -
6
7
8
- T1, T16, T256 (01, 10, 11)
-
11
Output disabled
-: Don't care
92C820-136
2007-02-16
TMP92C820
3.8
External Memory Extension Function (MMU)
This is MMU function which can expand program/data area to 136 Mbytes by having 4 local area. Address pins to external memory are 2 extended address bus pins (EA24, EA25) and 8 extended chip select pins ( CS2A to CS2G and CSEXA ) in addition to 24 address bus pins (A0 to A23) which are common specification of TLCS-900/H1 and 4 chip select pins ( CS0 to CS3 ) output from MEMC. The feature and the recommendation setting method of two types are shown below. In addition, AH in the table is the value which number address 23 to 16 displayed as hex. For Standard Extended Memory For Many Kinds Class Extended Memory
Purpose
Program ROM
Item
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
2 Mbytes: COMMON2 + 14 Mbytes: BANK (16 Mbytes x 1 pcs) LOCAL2 (AH = C0 to DF: 2 Mbytes x 7 BANK) Setup AH = "80 to FF" to CS2
CS2A
Data ROM
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
96 Mbytes (16 Mbytes x 6 pcs) LOCAL3 (AH = 80 to BF: 4 Mbytes x 24 BANK) Setup AH = "80 to FF" to CS2
CS2B , CS2C , CS2D , CS2E , CS2F , CS2G
Data SDRAM*
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
2 Mbytes: COMMON1 + 14 Mbytes: BANK (16 Mbytes x 1 pcs) LOCAL1 (AH = 40 to 5F: 2 Mbytes x 7 BANK) Setup AH = "40 to 7F" to CS1
CS1
Data RAM
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
1 Mbyte: COMMON0 + 7 Mbytes: BANK (8 Mbytes x 1 pcs) LOCAL0 (AH = 10 to 1F: 1 Mbyte x 7 BANK) Setup AH = "00 to 1F" to CS3
CS3
Extended memory 1
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
1 Mbyte (1 Mbyte x 1 pcs) None Setup AH = "20 to 2F" to CS0
CS0
Extended memory 2
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
256 Kbytes (256 Kbytes x 1 pcs) None Setup AH = "30 to 3F" to CSEX
CSEXA
Extended memory 3 (Direct address assigned built-in type LCD driver)
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
256 Kbytes (64 Kbytes x 4 pcs) None Setup AH = "30 to 3F" to CSEX D1BSCP, D2BLP, D3BFR, DLEBCD 512 Kbytes None Setup AH = "30 to 3F" to CSEX None
Extended memory 4
Maximum memory size Used local area, BANK number Setting MEMC Used CS pin
*Note: SDRAM must be mapped in LOCAL1 area. It can't use other area.
92C820-137
2007-02-16
TMP92C820 3.8.1 Recommendable Memory Map
The recommendation logic address memory map at the time of variety extension memory correspondence is shown in Figure 3.8.1. And, a physical-address map is shown in Figure 3.8.2. However, when memory area is less than 16 Mbytes and is not expanded, please refer to section of MEMC. Setting of register in MMU is not necessary. Since it is being fixed, the address of a local-area cannot be changed. When SDRAM is used, must locate to LOCAL1 area.
0H 1H
Address 000000H
Size 1 Mbyte
Memory map COMMON0 LOCAL0 0 1 2
BANK
CS/WAIT
CS pin
100000H 200000H 300000H 380000H 3C0000H 3D0000H 3E0000H 3F0000H 400000H 600000H
CS3 3 4 5 6 7 CS0 CSEX CSEX CSEX CSEX CSEX CSEX
CS3
1 Mbyte 1 Mbyte 512 Kbytes 256 Kbytes 64 Kbytes 64 Kbytes 64 Kbytes 64 Kbytes 2 Mbytes 2 Mbytes
CS0
to
CSEXA
D1BSCP D2BLP D3BFR DLEBCD
LOCAL1 COMMON1
0
1
2
3
4
5
6
7 CS1
CS1
800000H
CS2B (BANK0 to BANK3) CS2C (BANK4 to BANK7) CS2D (BANK8 to BANK11) CS2E (BANK12 to BANK15) CS2F (BANK16 to BANK19)
4 Mbytes
LOCAL3
0
1
2
22 23
CS2
C00000H 2 Mbytes E00000H 2 Mbytes FFFF00H FFFFFFH 256 bytes COMMON2 Vector area LOCAL2 0 1 2 3 4 5 6 7 CS2
CS2G (BANK20 to BANK23)
CS2A
: Internal area : Overlapped with COMMON area
Figure 3.8.1 Logical Address Map
92C820-138
2007-02-16
TMP92C820
TMP92C820 LOCAL0
CS3
LOCAL1
CS1
LOCAL2
CS2A CS2B
LOCAL3
CS2E
for data RAM (SDRAM non support) (8 Mbytes) 000000H BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7
for option program ROM (SDRAM support) (16 Mbytes) BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7
for program ROM (16 Mbytes)
for data ROM (16 Mbytes x 6)
BANK0 BANK0 BANK1 BANK2 BANK1 BANK3 BANK4 BANK2 BANK5 BANK6 BANK3 BANK7 BANK15 BANK14 BANK13 BANK12
Internal-I/O and RAM 800000H
1000000H
CS2C CS2F
000000H Reset and Interrupt vector area
BANK4
BANK16
BANK5
BANK17
BANK6
BANK18
BANK7 1000000H
CS2D
BANK19
CS2G
000000H BANK8 BANK20
BANK9
BANK21
BANK10 : Internal area : Overlapped with COMMON area BANK11 1000000H
BANK22
BANK23
Figure 3.8.2 Physical Address Map
92C820-139
2007-02-16
TMP92C820 3.8.2 Block Diagram
CPU out address A23 to A8 A23 to A16 Decoder A23 to A20 LOCAL0 register LOCAL1 register LOCAL2 register LOCAL3 register L0E L1E L2E L3E EA22 to EA20 EA23 to EA21 EA23 to EA21 Selector EA26 to EA22 (To external address bus pins) Physical address VA26 to VA20 Selector Physical address WA26 to WA7
LOCAL3 area detect signal
Internal data bus CPU out address A19 to A7
CPU out address A23 to A16 LOCAL3 area detect signal LOCAL3 register Decoder
CS2A CS2B CS2C CS2D CS2E CS2F CS2G
CSEXA
Figure 3.8.3 Block Diagram of MMU
92C820-140
2007-02-16
TMP92C820 3.8.3 Control Registers
LOCAL0 Register 7
LOCAL0 (01D0H) Bit symbol Read/Write After reset Function L0E R/W 0 Use BANK for LOCAL0 0: Not use 1: Use 0
6
5
4
3
2
L0EA22
1
L0EA21 R/W 0
0
L0EA20 0
Setting BANK number for LOCAL0
LOCAL1 Register 7
LOCAL1 (01D1H) Bit symbol Read/Write After reset Function L1E R/W 0 Use BANK for LOCAL1 0: Not use 1: Use 0
6
5
4
3
2
L1EA23
1
L1EA22 R/W 0
0
L1EA21 0
Setting BANK number for LOCAL1
LOCAL2 Register 7
LOCAL2 (01D2H) Bit symbol Read/Write After reset Function L2E R/W 0 Use BANK for LOCAL2 0: Disable 1: Enable 0
6
5
4
3
2
L2EA23
1
L2EA22 R/W 0
0
L2EA21 0
Setting BANK number for LOCAL2
LOCAL3 Register 7
LOCAL3 (01D3H) Bit symbol Read/Write After reset Function L3E R/W 0 Use BANK for LOCAL3 0: Disable 1: Enable 0 0
00000 to 00011 CS2B 01000 to 01011 CS2D 10000 to 10011 CS2F
6
5
4
L3EA26
3
L3EA25
2
L3EA24 R/W 0
00100 to 00111 CS2C 01100 to 01111 CS2E 10100 to 10111 CS2G
1
L3EA23 0
0
L3EA22 0
11000 to 11111: Set prohibition
Figure 3.8.4 MMU Control Register
92C820-141
2007-02-16
TMP92C820 3.8.4 Operational Description
Setup bank value and bank use in bank setting register of each local area of LOCAL register in common area. Moreover, in that case, a combination pin is set up and the MEMC simultaneously sets up mapping. When CPU outputs logical address of the local area, MMU outputs physical address to the outside pin according to value of bank setting register. Access of external memory becomes possible therefore. Common area located in each local area should be passed surely when changing BANK. For example, when the program jump BANK0 of LOCAL2 to BANK6, please jump from BANK0 to COMMON2 once and afterwards jump to BANK6. Please do not use as bank that overlaps with another bank since this common area overlaps with either of eight banks of local area on the physical map. Example program is as next page follows.
92C820-142
2007-02-16
TMP92C820
SRAM 8 Mbytes 8 bits
CS0
Data/Stack RAM
CS0
000000H~1FFFFFH (Logical) 000000H~7FFFFFH (Physical)
CS1
Data Address TMP92C820
RD WRLL , WRLU , WRUL , WRUU SRLLB , SRLUB , SRULB , SRUUB : SRAM
SDRAM 16 Mbytes 16 bits
Display SDRAM
CS1
400000H~7FFFFFH (Logical) 000000H~FFFFFFH (Physical)
Program ROM MROM 16 Mbytes 16 bits
CS2
SDCLK, SDCKE SDLLDQM, SDLUDQM, SDULDRM, SDUUDQM SDCSL , SDCSH , SDRAS , SDCAS , SDWE
CS2
C00000H~FFFFFFH (Logical) 000000H~FFFFFFH (Physical)
EA24, EA25 Data ROM
CS3
MROM 64 Mbytes 16 bits
CS3
800000H~BFFFFFH (Logical) 000000H~3FFFFFH (Physical)
* In case of 16-bit bus memory, address connection is ...: CPU A1 = Memory A0, CPU A2 = Memory A1... * In case of 8-bit bus memory, address connection is ...: CPU A0 = Memory A0, CPU A1 = Memory A1...
Figure 3.8.5 H/W Setting Example At, Figure 3.8.5 it shows example of connection TMP92C820 and some memories: Program ROM: MROM, 16 Mbytes, Data ROM: MROM, 64 Mbytes, Data RAM of 8-bit bus: SRAM, 8 Mbytes, Display RAM: SDRAM, 16 Mbytes. In case of 16-bit bus memory connection, it needs to shift 1-bit address bus from TMP92C820 and 8-bit bus case, direct connection address bus from TMP92C820. In that figure, logical address and physical address are shown. And each memory allot each chip select signal, RAM: CS0 , SDRAM: CS1 , Program MROM: CS2 , Data MROM: CS3 . In case of this example, as data MROM is 64 Mbytes, this MROM connect to EA24 and EA25. Initial condition after reset, because TMP92C820 access from CS2 area, CS2 area allots to program ROM. It can set free setting except program ROM.
2H
92C820-143
2007-02-16
TMP92C820
; Initial Setting ; CS0 LD LD LD LD ; CS1 LD LD LD LD ; CS2 LD LD LD LD ; CS3 LD LD LD LD ; CSX LD LD ; Port LD LD ~ LDW LD LD ~ LD
(MSAR0), 00H (MAMR0), FFH (B0CSL), 22H (B0CSH), 80H (MSAR1), 40H (MAMR1), FFH (B1CSL), 11H (B1CSH), 8DH (MSAR2),C0H (MAMR2), 7FH (B2CSL), 11H (B2CSH), 0C1H (MSAR3), 80H (MAMR3), 7FH (B3CSL), 66H (B3CSH), 81H (BEXCSL), 11H (BEXCSH), 01H (P8FC), 3FH (P8FC2), 02H (P7CR), 1F1FH (PJFC), 0FFH (SDACR), 083H
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
Logical address area: 000000H to 1FFFFFH Logical address size: 2 Mbytes Condition: WR 3 states (1 wait), RD 3 states (1 wait) SRAM, 8 bits Logical address area: 400000H to 7FFFFFH Logical address size: 4 Mbytes Condition: WR 2 states (0 waits) RD 2 states (0 waits) Condition: SDRAM, 16 bits Logical address area: C00000H to FFFFFFH Logical address size: 4 Mbytes Condition: WR 2 states (0 waits) RD 2 states (0 waits) Condition: ROM, 16 bits Logical address area: 800000H to BFFFFFH Logical address size: 4 Mbytes Condition: WR 5 states (3 waits), RD 5 states (3 waits) Condition: ROM,16 bits
; Condition: WR 2 states (0 waits), RD 2 states (0 waits) ; Condition: 16 bits ; CS0 to CS3 , EA24, EA25: port 8 setting ; CS1 SDCSL setting ; WRUU , WRUL , WRLU , WRLL , RD ; PJ<7:0> = SDRAM control ; Add-MUX select type B, SDRAM, auto init enable SDRAM setup time ; Interval refresh
(SDRCR), 01H
Figure 3.8.6 Bank Operation S/W Example 1 Secondly, it shows example of initial setting at Figure 3.8.6. Because CS0 connect to RAM: 8-bit bus, 8 Mbytes, it need to set 8-bit bus. At this example, it set 3 states setting. In the same way CS1 set to 16-bit bus and 2 states, CS2 set 16-bit bus and 2 states, CS3 set 16-bit bus and 5 states. By MEMC controller, each chip selection signal's memory size, don't set actual connect memory size, need to set that logical address size: fitting to each local area. Actual physical address is set by each area's BANK register setting. CSEX setting of MEMC is except above CS0 to CS3's setting. This program example isn't used CSEX setting. Finally pin condition is set. Ports 80 to 85 set to CS0 , CS1 , CS2 , CS3 , EA24, EA25, and SDRAM condition.
3H
92C820-144
2007-02-16
TMP92C820
; Bank Operation ; ***** CS2 ***** ORG 000000H ORG 200000H ORG 400000H ORG 600000H ORG 800000H ORG a00000H ORG c00000H ORG E00000H
; ; ; ; ; ; ;
Program ROM: Start address at BANK0 of LOCAL2 Program ROM: Start address at BANK1 of LOCAL2 Program ROM: Start address at BANK2 of LOCAL2 Program ROM: Start address at BANK3 of LOCAL2 Program ROM: Start address at BANK4 of LOCAL2 Program ROM: Start address at BANK5 of LOCAL2 Program ROM: Start address at BANK6 of LOCAL2
LD (LOCAL3), 85H LDW HL, (800000H) LD (LOCAL3), 88H LDW BC, (800000H) ~ ORG
; Program ROM: Start address at BANK7 (= COMMON2) of LOCAL2 ; Logical address E00000H to FFFFFFH ; Physical address 0E00000H to 0FFFFFFH ; LOCAL3 BANK5 set 14xxxxH ; Load data (5555H) form BANK5 (140000H: Physical address) of LOCAL3 ( CS3 ) ; LOCAL3 BANK8 set 20xxxxH ; Load data (AAAAH) form BANK8 (200000H: Physical address) of LOCAL3 ( CS3 ) ; Program ROM: End address at BANK7 (= COMMON2) of LOCAL2
FFFFFFH
; ***** ORG ORG ORG ORG ORG ORG ~ ORG ORG ORG ~ ORG ORG ORG ORG ORG ORG ORG ORG
CS3 *****
0000000H 0400000H 0800000H 0C00000H 1000000H 1400000H dw 5555H 1800000H 1C00000H 2000000H dw AAAAH 2400000H 2800000H 2C00000H 3000000H 3400000H 3800000H 3C00000H 3FFFFFFH
; ; ; ; ; ;
Data ROM: Start address at BANK0 of LOCAL3 Data ROM: Start address at BANK1 of LOCAL3 Data ROM: Start address at BANK2 of LOCAL3 Data ROM: Start address at BANK3 of LOCAL3 Data ROM: Start address at BANK4 of LOCAL3 Data ROM: Start address at BANK5 of LOCAL3
; Data ROM: Start address at BANK6 of LOCAL3 ; Data ROM: Start address at BANK7 of LOCAL3 ; Data ROM: Start address at BANK8 of LOCAL3
; ; ; ; ; ; ; ;
Data ROM: Start address at BANK9 of LOCAL3 Data ROM: Start address at BANK10 of LOCAL3 Data ROM: Start address at BANK11 of LOCAL3 Data ROM: Start address at BANK12 of LOCAL3 Data ROM: Start address at BANK13 of LOCAL3 Data ROM: Start address at BANK14 of LOCAL3 Data ROM: Start address at BANK15 of LOCAL3 Data ROM: End address at BANK15 of LOCAL3
Figure 3.8.7 Bank Operation S/W Example 2 Here shows example of data access between one BANK and other BANK. Figure 3.8.7 is one software example. A dot line square area shows one memory and each dot line square shows CS2 's program ROM and CS3 's data ROM. Program start from E00000H address, firstly, write to BANK register of LOCAL3 area upper 5-bit address of access point. In case of this example, because most upper address bit of physical address is EA25, most upper address bit of BANK register is meaningless. 4 bits of upper 5 bits address means 16 BANKs. After setting BANK5, accessing 800000H to BFFFFFH address: Logical LOCAL3 address, actually access to physical 1400000H to 1700000H address.
4H
92C820-145
2007-02-16
TMP92C820
; Bank Operation ; ***** CS2 ***** ORG 000000H ORG 200000H NOP ~ JP E00100H ORG 400000H ORG 600000H NOP ~ JP E00200H ORG 800000H ORG a00000H ORG c00000H !!!! Program Start !!!! ORG E00000H
; Program ROM: Start address at BANK0 of LOCAL2 ; Program ROM: Start address at BANK1 of LOCAL2 ; Operation at BANK1 of LOCAL2 ; ; ; ; ; ; ; ; Jump to BANK7 (= COMMON2) of LOCAL2 Program ROM: Start address at BANK2 of LOCAL2 Program ROM: Start address at BANK3 of LOCAL2 Operation at BANK3 of LOCAL2 Jump to BANK7 (= COMMON2) of LOCAL2 Program ROM: Start address at BANK4 of LOCAL2 Program ROM: Start address at BANK5 of LOCAL2 Program ROM: Start address at BANK6 of LOCAL2
LD JP ~ ORG
(LOCAL2), 81H C00000H
; Program ROM: Start address at BANK7 (= COMMON2) of LOCAL2 ; Logical address E00000H to FFFFFFH ; Physical address 0E00000H to 0FFFFFFH ; LOCAL2 BANK1 set 20xxxxH ; Jump to BANK1 (200000H: Physical address) of LOCAL2
E00100H LD (LOCAL2), 83H JP C00000H E00200H LD (LOCAL1), 00H LD (LSARCH), 60H LD (LSARCM), 00H LD (LSARCL), 00H SET 0, (LCTCTL) FFFFFFH
; LOCAL2 BANK3 set 60xxxxH ; Jump to BANK3 (600000H: Physical address) of LOCAL2
~ ORG ~
ORG
; ; ; ; ; ; ;
Disable Bank! LCD display set C_area start address C_area start address C_area start address LCD Display start Program ROM: End address at BANK7 (= COMMON2) of LOCAL2
; ***** ORG ORG ORG ORG ~ ORG ORG ORG ORG ORG
CS1 *****
000000H 200000H 400000H 600000H dl 01234567H
; ; ; ; ;
SDRAM: Start address at BANK0 of LOCAL1 SDRAM: Start address at BANK1 of LOCAL1 SDRAM: Start address at BANK2 of LOCAL1 SDRAM: Start address at BANK3 (= COMMON1) of LOCAL1 display data
800000H a00000H c00000 E00000H FFFFFFH
; ; ; ; ;
SDRAM: Start address at BANK4 of LOCAL1 SDRAM: Start address at BANK5 of LOCAL1 SDRAM: Start address at BANK6 of LOCAL1 SDRAM: Start address at BANK7 of LOCAL1 SDRAM: End address at BANK7 of LOCAL1
Figure 3.8.8 Bank Operation S/W Example 3
92C820-146
2007-02-16
TMP92C820
At Figure 3.8.8, it shows example of program jump. In the same way with before example, two dot line squares show each CS2 's program ROM and CS1 's (SDCS) SDRAM. Program start from E00000H common address, firstly, write to BANK register of LOCAL2 area upper 3-bit address of jumping point. After setting BANK1, jumping C00000H to DFFFFFH address: Logical LOCAL2 address, actually jump to physical 200000H to 3FFFFFH address. When return to common area, it can only jump to E00000H to FFFFFFH without writing to BANK register of LOCAL2 area. By a way of setting of BANK register, the setting that BANK address and common address conflict with is possible. When two kinds or more logical addresses to show common area exist, management of BANK is confused. We recommends not to use the BANK setting, BANK address and common address conflict with. Please set similarly when jumping through CS . After setting BANK4, jumping 400000H to 5FFFFFH address: Logical local area of CS1 , actually jump to physical 800000H to 9FFFFFH address. When using LCD display data for SDRAM, we recommend setting display area to common area in SDRAM. Because of, LCD displays DMA occurs at synchronous less. If SDRAM bank is change; you don't need to care only common area. It is a mark paid attention to here, it needs to go by way of common area by all means when moves from a bank to a bank. In other words, it must write to BANK register only in common area and it prohibits writing the BANK registers in BANK area. If it modify the BANK register's data in BANK area, program run away. Please do not set bank function of MMU as display RAM. This is because reading LCDC display data is not controlled by the CPU. Therefore if BANK of display area is changed during LCD displaying, it cannot display. It is recommended to allocate display data to a common area.
5H
92C820-147
2007-02-16
TMP92C820
3.9
Serial Channels (SIO)
The TMP92C820 includes three serial I/O channels. For each channel either UART mode (Asynchronous transmission) or I/O interface mode (Synchronous transmission) can be selected. (Channel 2 can be selected only UART mode.) * I/O interface mode Mode 0: For transmitting and receiving I/O data using the synchronizing signal SCLK for extending I/O. Mode 1: 7-bit data * UART mode Mode 2: 8-bit data Mode 3: 9-bit data In mode 1 and mode 2 a parity bit can be added. Mode 3 has a wakeup function for making the master controller start slave controllers via a serial link (Multi-controller system). Figure 3.9.2, Figure 3.9.3, and Figure 3.9.4 are block diagrams for each channel. Each channel can be used independently. Each channel operates in the same fashion except for the following points; hence only the operation of channel 0 is explained below.
0H 1H 2H
Table 3.9.1 Differences between Channels 0 to 2 Channel 0
Pin name TXD0 (PF0) RXD0 (PF1) CTS0 /SCLK0 (PF2) Yes
Channel 1
TXD1 (PF3) RXD1 (PF4) CTS1 /SCLK1 (PF5) No
Channel 2
TXD2 (P95) RXD2 (P96) No
IrDA mode
This chapter contains the following sections: 3.9.1 Block Diagrams 3.9.2 Operation for Each Circuit 3.9.3 SFRs 3.9.4 Operation in Each Mode 3.9.5 Support for IrDA
3H 4H 5H 6H 7H 8H 9H 10H 1H 12H
92C820-148
2007-02-16
TMP92C820
* Mode 0 (I/O interface mode)
Bit0 1 2 3 4 5 6 7
Transfer direction
* Mode 1 (7-bit UART mode)
No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 Stop Parity Stop
* Mode 2 (8-bit UART mode)
No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Stop Parity Stop
* Mode 3 (9-bit UART mode)
Start Wakeup Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 Bit8 Stop Stop
When bit8 = 1, address (Select code) is denoted. When bit8 = 0, data is denoted.
Figure 3.9.1 Data Formats
92C820-149
2007-02-16
TMP92C820 3.9.1 Block Diagrams
Prescaler T0 2 4 8 16 32 64 T2 T8 T32
Serial clock generation circuit BR0CR BR0CR BR0ADD Prescaler T0 T2 T8 T32 Selector TA0TRG (from TMRA0)
Selector
UART mode Selector
SIOCLK
BR0CR Baud rate generator fIO
SC0MOD0 SC0MOD0 /2 Selector
SCLK0 IN (Shared with PF2)
I/O interface mode
SCLK0 OUT (Shared with PF2)
I/O interface mode
SC0CR INT request INTRX0 INTTX0 Serial channel interrupt control Transmision counter (UART only / 16) TXDCLK Transmission control SC0CR Parity control SC0MOD0
CTS0
Receive counter SC0MOD0 (UART only / 16) RXDCLK Receive control SC0MOD0
(Shared with PF2)
RXD0 (Shared with PF1)
Receive buffer 1 (Shift register)
RB8 Receive buffer 2 (SC0BUF)
Error flag
TB8
Transmission buffer (SC0BUF)
SC0CR Internal data bus
TXD0 (Shared with PF0)
Figure 3.9.2 Block Diagram of Serial Channel 0
92C820-150
2007-02-16
TMP92C820
Prescaler T0 2 4 8 16 32 64 T2 T8 T32
Serial clock generation circuit BR1CR BR1CR BR1ADD Prescaler T0 T2 T8 T32 Selector TA0TRG (from TMRA0)
Selector
UART mode Selector
SIOCLK
BR1CR Baud rate generator fIO
SC1MOD0 SC1MOD0 /2 Selector
SCLK1 IN (Shared with PF5)
I/O interface mode
SCLK1 OUT (Shared with PF5)
I/O interface mode
SC1CR INT request INTRX1 INTTX1 Serial channel interrupt control Transmision counter
(UART only / 16)
Receive counter SC1MOD0 (UART only / 16) RXDCLK Receive control SC1MOD0
TXDCLK Transmission control SC1CR SC1MOD0
CTS1
(Shared with PF5)
RXD1 (Shared with PF4)
Receive buffer 1 (Shift register)
Parity control
RB8 Receive buffer 2 (SC1BUF)
Error flag
TB8
Transmission buffer (SC1BUF)
SC1CR Internal data bus
TXD1 (Shared with PF3)
Figure 3.9.3 Block Diagram of Serial Channel 1
92C820-151
2007-02-16
TMP92C820
Prescaler T0 2 4 8 16 32 64 T2 T8 T32
Serial clock generation circuit BR2CR BR2CR BR2ADD Prescaler T0 T2 T8 T32 Selector TA0TRG (from TMRA0)
Selector
UART mode Selector
SIOCLK
BR2CR Baud rate generator fIO
SC2MOD0 SC2MOD0 /2 Selector
SCLK1 IN (Shared with PF5)
I/O interface mode
SC2CR INT request INTRX2 INTTX2 Receive counter SC2MOD0 (UART only / 16) RXDCLK Receive control SC2MOD0 SC2CR
Receive buffer 1 (Shift register)
Serial channel interrupt control
Transmision counter
(UART only / 16)
TXDCLK Transmission control
RXD2 (Shared with P96)
Parity control
RB8 Receive buffer 2 (SC2BUF)
Error flag
TB8
Transmission buffer (SC2BUF)
SC2CR Internal data bus
TXD2 (Shared with P95)
Figure 3.9.4 Block Diagram of Serial Channel 2
92C820-152
2007-02-16
TMP92C820 3.9.2 Operation for Each Circuit
(1) Prescaler, prescaler clock select There is a 6-bit prescaler for waking serial clock. The prescaler can be run by selecting the baud rate generator as the waking serial clock. Table 3.9.2 shows prescaler clock resolution into the baud rate generator.
13H
Table 3.9.2 Prescaler Clock Resolution to Baud Rate Generator
- Clock gear selection SYSCR1 000(1/1) 001(1/2) fc 010(1/4) 011(1/8) 100(1/16) 1/8
Baud rate generator input clock
- T0 fc/8 fc/16 fc/32 fc/64 fc/128 SIO prescaler BR0CR T2(1/4) fc/32 fc/64 fc/128 fc/256 fc/512 T8(1/16) fc/128 fc/256 fc/512 fc/1024 fc/2048 T32(1/64) fc/512 fc/1024 fc/2048 fc/4096 fc/8192
The baud rate generator selects between 4 clock inputs: T0, T2, T8, and T32 among the prescaler outputs.
92C820-153
2007-02-16
TMP92C820
(2) Baud rate generator The baud rate generator is a circuit which generates transmission and receiving clocks that determine the transfer rate of the serial channels. The input clock to the baud rate generator, T0, T2, T8, or T32, is generated by the 6-bit prescaler which is shared by the timers. One of these input clocks is selected using the BR0CR field in the baud rate generator control register. The baud rate generator includes a frequency divider, which divides the frequency by 1 or N + (16 - K)/16 or 16 values, thereby determining the transfer rate. The transfer rate is determined by the settings of BR0CR and BR0ADD. * In UART mode The settings BR0ADD are ignored. The baud rate generator divides the selected prescaler clock by N, which is set in BR0CK. (N = 1, 2, 3...16) (2) When BR0CR = 1 The N + (16 - K)/16 division function is enabled. The baud rate generator divides the selected prescaler clock by N + (16 - K)/16 using the value of N set in BR0CR (N = 2, 3...15) and the value of K set in BR0ADD (K = 1, 2, 3...5) Note: If N = 1 or N = 16, the N + (16 - K)/16 division function is disabled. Set BR0CR to 0. * In I/O interface mode
(1) When BR0CR = 0
The N + (16 - K)/16 division function is not available in I/O interface mode. Set BR0CR to 0 before dividing by N. The method for calculating the transfer rate when the baud rate generator is used is explained below. * In UART mode Baud rate *
=
Input clock of baud rate generator / 16 Frequency divider for baud rate generator
In I/O interface mode Input clock of baud rate generator /2 Baud rate = Frequency divider for baud rate generator
92C820-154
2007-02-16
TMP92C820
* Integer divider (N divider) For example, when the source clock frequency (fC) is 39.3216 MHz, the input clock is T2 (fC/32), the frequency divider N (BR0CR) = 8, and BR0CR = 0, the baud rate in UART mode is as follows:
* Clock
state
Clock gear:
1/1 (fC)
Baud rate =
fC/32 / 16 8 = 39.3216 x 106 / 16 / 8 / 16 = 9600 (bps)
Note: *
The N + (16 - K)/16 division function is disabled and setting BR0ADD is invalid. N + (16 - K)/16 divider (UART mode only)
Accordingly, when the source clock frequency (fC) = 31.9488 MHz, the input clock is T2 (fC/32), the frequency divider N (BR0CR) = 6, K (BR0ADD) = 8, and BR0CR = 1, the baud rate in UART mode is as follows: * Clock state Clock gear: 1/1 (fC)
Baud rate =
fC/32 (16 - 8) 6+ 16
/ 16
8 16
= 31.9488 x 106 / 16 / (6 +
) / 16 =
9600 (bps)
Table 3.9.3 show examples of UART mode transfer rates.
14H
Additionally, the external clock input is available in the serial clock (Serial channels 0 and 1). The method for calculating the baud rate is explained below: * In UART mode Baud rate = External clock input frequency / 16 It is necessary to satisfy (External clock input cycle) 4/fSYS * In I/O interface mode Baud rate = External clock input frequency It is necessary to satisfy (External clock input cycle) 16/fSYS
92C820-155
2007-02-16
TMP92C820
Table 3.9.3 Selection of Transfer Rate (1)
(When baud rate generator is used and BR0CR = 0) Unit (kbps)
Input Clock fSYS [MHz] Frequency Divider
9.8304 12.2880 14.7456 19.6608 22.1184 24.5760 2 4 8 10 5 A 2 3 6 C 1 2 4 8 10 3 1 2 4 5 8 A 10
T0 (fSYS/4)
76.800 38.400 19.200 9.600 38.400 19.200 115.200 76.800 38.400 19.200 307.200 153.600 76.800 38.400 19.200 115.200 384.000 192.000 96.000 76.800 48.000 38.400 24.000
T2 (fSYS/16)
19.200 9.600 4.800 2.400 9.600 4.800 28.800 19.200 9.600 4.800 76.800 38.400 19.200 9.600 4.800 28.800 96.000 48.000 24.000 19.200 12.000 9.600 6.000
T8 T32 (fSYS/64) (fSYS/256)
4.800 2.400 1.200 0.600 2.400 1.200 7.200 4.800 2.400 1.200 19.200 9.600 4.800 2.400 1.200 7.200 24.000 12.000 6.000 4.800 3.000 2.400 1.500 1.200 0.600 0.300 0.150 0.600 0.300 1.800 1.200 0.600 0.300 4.800 2.400 1.200 0.600 0.300 1.800 6.000 3.000 1.500 1.200 0.750 0.600 0.375
Note: Transfer rates in I/O interface mode are eight times faster than the values given above.
In UART mode, TMRA match detect signal (TA0TRG) can be used for serial transfer clock. Method for calculating the timer output frequency which is needed when outputting trigger of timer TA0TRG frequency = Baud rate x 16
Note: The TMRA0 match detect signal cannot be used as the transfer clock in I/O Interface mode.
92C820-156
2007-02-16
TMP92C820
(3) Serial clock generation circuit This circuit generates the basic clock for transmitting and receiving data. * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the basic clock is generated by dividing the output of the baud rate generator by 2, as described previously. In SCLK input mode with the setting SC0CR = 1, the rising edge or falling edge will be detected according to the setting of the SC0CR register to generate the basic clock. * In UART mode The SC0MOD0 setting determines whether the baud rate generator clock, the internal clock fIO, the match detect signal from timer TMRA0 or the external clock (SCLK0) is used to generate the basic clock SIOCLK. (4) Receiving counter The receiving counter is a 4-bit binary counter used in UART mode, which counts up the pulses of the SIOCLK clock. It takes 16 SIOCLK pulses to receive 1 bit of data; each data bit is sampled three times-on the 7th, 8th, and 9th clock cycles. The value of the data bit is determined from these three samples using the majority rule. For example, if the data bit is sampled respectively as 1, 0 and 1 on 7th, 8th and 9th clock cycles, the received data bit is taken to be 1. A data bit sampled as 0, 0 and 1 is taken to be 0. (5) Receiving control * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the RXD0 signal is sampled on the rising or falling edge of the shift clock which is output on the SCLK0 pin, according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the RXD0 signal is sampled on the rising or falling edge of the SCLK0 input, according to the SC0CR setting. * In UART mode The receiving control block has a circuit, which detects a start bit using the majority rule. Received bits are sampled three times; when two or more out of three samples are 0, the bit is recognized as the start bit and the receiving operation commences. The values of the data bits that are received are also determined using the majority rule.
92C820-157
2007-02-16
TMP92C820
(6) The receiving buffers To prevent overrun errors, the receiving buffers are arranged in a double-buffer structure. Received data is stored one bit at a time in receiving buffer 1 (which is a shift register). When 7 or 8 bits of data have been stored in receiving buffer 1, the stored data is transferred to receiving buffer 2 (SC0BUF); this causes an INTRX0 interrupt to be generated. The CPU only reads receiving buffer 2 (SC0BUF). Even before the CPU reads receiving buffer 2 (SC0BUF), the received data can be stored in receiving buffer 1. However, unless receiving buffer 2 (SC0BUF) is read before all bits of the next data are received by receiving buffer 1, an overrun error occurs. If an overrun error occurs, the contents of receiving buffer 1 will be lost, although the contents of receiving buffer 2 and SC0CR will be preserved. SC0CR is used to store either the parity bit-added in 8-bit UART mode-or the most significant bit (MSB) -in 9-bit UART mode. In 9-bit UART mode the wakeup function for the slave controller is enabled by setting SC0MOD0 to 1; in this mode INTRX0 interrupts occur only when the value of SC0CR is 1. SIO interrupt mode is selectable by the register SIMC. (7) Transmission counter The transmission counter is a 4-bit binary counter which is used in UART mode and which, like the receiving counter, counts the SIOCLK clock pulses; a TXDCLK pulse is generated every 16 SIOCLK clock pulses.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Figure 3.9.5 Generation of the Transmission Clock (8) Transmission controller * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the data in the transmission buffer is output one bit at a time to the TXD0 pin on the rising or falling edge of the shift clock which is output on the SCLK0 pin, according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the data in the transmission buffer is output one bit at a time on the TXD0 pin on the rising or falling edge of the SCLK0 input, according to the SC0CR setting. * In UART mode When transmission data sent from the CPU is written to the transmission buffer, transmission starts on the rising edge of the next TXDCLK, generating a transmission shift clock TXDSFT.
92C820-158
2007-02-16
TMP92C820
Handshake function Serial channels 0, 1 each has a CTS pin. Use of this pin allows data can be sent in units of one frame; thus, overrun errors can be avoided. The handshake functions is enabled or disabled by the SC0MOD setting. When the CTS0 pin goes high on completion of the current data send, data transmission is halted until the CTS0 pin goes low again. However, the INTTX0 interrupt is generated, it requests the next data send to the CPU. The next data is written in the transmission buffer and data sending is halted. Though there is no RTS pin, a handshake function can be easily configured by setting any port assigned to be the RTS function. The RTS should be output "high" to request send data halt after data receive is completed by software in the RXD interrupt routine.
TMP92C820 TMP92C820
TXD
CTS
RXD
RTS (Any port)
Sender
Receiver
Figure 3.9.6 Handshake Function
Timing to write to the transmission buffer
CTS
Send is suspended (1)from (1) and (2). (2) 13 14 15 16 1 2 3 14 15 16 1 2 3
SIOCLK TXDCLK TXD Start bit Bit0
Note 1: If the CTS signal goes high during transmission, no more data will be sent after completion of the current
transmission. Note 2: Transmission starts on the first falling edge of the TXDCLK clock after the CTS signal has fallen.
Figure 3.9.7 CTS (Clear to send) Timing
92C820-159
2007-02-16
TMP92C820
(9) Transmission buffer The transmission buffer (SC0BUF) shifts out and sends the transmission data written from the CPU form the least significant bit (LSB) in order. When all the bits are shifted out, the transmission buffer becomes empty and generates an INTTX0 interrupt. (10) Parity control circuit When SC0CR in the serial channel control register is set to 1, it is possible to transmit and receive data with parity. However, parity can be added only in 7-bit UART mode or 8-bit UART mode. The SC0CR field in the serial channel control register allows either even or odd parity to be selected. In the case of transmission, parity is automatically generated when data is written to the transmission buffer SC0BUF. The data is transmitted after the parity bit has been stored in SC0BUF in 7-bit UART mode or in SC0MOD0 in 8-bit UART mode. SC0CR and SC0CR must be set before the transmission data is written to the transmission buffer. In the case of receiving, data is shifted into receiving buffer 1, and the parity is added after the data has been transferred to receiving buffer 2 (SC0BUF), and then compared with SC0BUF in 7-bit UART mode or with SC0CR in 8-bit UART mode. If they are not equal, a parity error is generated and the SC0CR flag is set. (11) Error flags Three error flags are provided to increase the reliability of data reception. 1. Overrun error If all the bits of the next data item have been received in receiving buffer 1 while valid data still remains stored in receiving buffer 2 (SC0BUF), an overrun error is generated. The below is a recommended flow when the overrun error is generated. (INTRX interrupt routine) (1) Read receiving buffer (2) Read error flag (3) If = 1 then (a) (b) (c) (d) (e) (f) 2. Set to disable receiving (Write "0" to SC0MOD0) Wait to terminate current frame Read receiving buffer Read error flag Set to enable receiving (Write "1" to SC0MOD0) Request to transmit again
(4) Other Parity error The parity generated for the data shifted into receiving buffer 2 (SC0BUF) is compared with the parity bit received via the RXD pin. If they are not equal, a parity error is generated.
92C820-160
2007-02-16
TMP92C820
3. Framing error The stop bit for the received data is sampled three times around the center. If the majority of the samples are 0, a framing error is generated. (12) Timing generation 1. In UART mode Receiving Mode
Interrupt timing Framing error timing Parity error timing Overrun error timing 9 Bits (Note) Center of last bit (Bit8) Center of stop bit
-
8 Bits + Parity (Note) Center of last bit (Parity bit) Center of stop bit Center of last bit (Parity bit) Center of last bit (Parity bit)
8 Bits, 7 Bits + Parity, 7 Bits Center of stop bit Center of stop bit Center of stop bit Center of stop bit
Center of last bit (Bit8)
Note1: In 9-bit and 8-bit parity modes, interrupts coincide with the ninth bit pulse. Thus, when servicing the interrupt, it is necessary to wait for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error. Note2: The higher the transfer rate, the later than the middle receive interrupts and errors occur.
Transmitting Mode
Interrupt timing 9 Bits Just before stop bit is transmitted 8 Bits + Parity
8 Bits, 7 Bits + Parity, 7 Bits
2.
I/O interface
SCLK output mode SCLK input mode SCLK output mode SCLK input mode Immediately after last bit data. (See Figure 3.9.25)
15H
Transmission Interrupt timing Receiving Interrupt timing
Immediately after rise of last SCLK signal rising mode, or immediately after fall in falling mode.) (See Figure 3.9.26)
16H
Timing used to transfer received to data receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK) (See Figure 3.9.27)
17H
Timing used to transfer received data to receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK). (See Figure 3.9.28)
18H
92C820-161
2007-02-16
TMP92C820 3.9.3 SFRs
7
SC0MOD0 Bit symbol (1202H) Read/Write After reset Function TB8 0 Transfer data bit8
6
CTSE 0 Hand shake 0: CTS disable 1: CTS enable
5
RXE 0 Receive function 0: Receive disable 1: Receive enable
4
WU R/W 0 Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Serial transmission mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock (UART) 00: TA0TRG 01: Baud rate generator 10: Internal clock fIO 11: External clock (SCLK0 input)
Serial transmission clock source (UART) 00 01 10 11 TMRA0 match detect signal Baud rate generator Internal clock fIO External clock (SCLK0 input)
Note: The clock selection for the I/O interface mode is controlled by the serial control register (SC0CR). Serial transmission mode 00 01 10 11 Wakeup function 9-bit UART 0 1 Interrupt generated when data is received Interrupt generated only when SC0CR = 1 Don't care Other modes UART mode I/O interface mode 7-bit mode 8-bit mode 9-bit mode
Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 1 Disabled (Always transferable) Enabled
Transmission data bit8
Figure 3.9.8 Serial Mode Control Register (Channel 0, SC0MOD0)
92C820-162
2007-02-16
TMP92C820
7
SC1MOD0 Bit symbol (120AH) Read/Write After reset Function TB8 0 Transfer data bit8
6
CTSE 0 Hand shake 0: CTS disable 1: CTS enable
5
RXE 0 Receive function 0: Receive disable 1: Receive enable
4
WU R/W 0 Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Serial transmission mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock (UART) 00: TA0TRG 01: Baud rate generator 10: Internal clock fIO 11: External clock (SCLK1 input)
Serial transmission clock source (for UART) 00 01 10 11 TMRA0 match detect signal Baud rate generator Internal clock fIO External clock (SCLK1 input)
Note: The clock selection for the I/O interface mode is controlled by the serial control register (SC1CR). Serial transmission mode 00 01 10 11 Wakeup function 9-bit UART 0 1 Interrupt generated when data is received Interrupt generated only when SC1CR = 1 Don't care Other modes UART mode I/O interface mode 7-bit mode 8-bit mode 9-bit mode
Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 1 Disabled (Always transferable) Enabled
Transmission data bit8
Figure 3.9.9 Serial Mode Control Register (Channel 1, SC1MOD0)
92C820-163
2007-02-16
TMP92C820
7
SC2MOD0 Bit symbol (1212H) Read/Write After reset Function TB8 0 Transfer data bit8
6
-
5
RXE 0
4
WU R/W 0 Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
0
Always write Receive "0". function 0: Receive disable 1: Receive enable
Serial transmission mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock (UART) 00: TA0TRG 01: Baud rate generator 10: Internal clock fIO 11: Reserved
Serial transmission clock source (for UART) 00 01 10 11 TMRA0 match detect signal Baud rate generator Internal clock fIO Reserved
Serial transmission mode 00 01 10 11 Wakeup function 9-bit UART 0 1 Interrupt generated when data is received Interrupt generated only when SC2CR = 1 Don't care Other modes UART mode I/O interface mode 7-bit mode 8-bit mode 9-bit mode
Receiving function 0 1 Receive disabled Receive enabled
Transmission data bit8
Figure 3.9.10 Serial Mode Control Register (Channel 2, SC2MOD0)
92C820-164
2007-02-16
TMP92C820
7
SC0CR (1201H) Bit symbol Read/Write After reset Function RB8 R Undefined Received data bit8
6
EVEN R/W 0 Parity 0: Odd 1: Even
5
PE 0 Parity addition 0: Disable 1: Enable
4
OERR 0 Overrun
3
PERR 0 1: Error Parity
2
FERR 0 Framing
1
SCLKS R/W 0 0: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (Cleared to 0 when read)
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Edge selection for SCLK pin (Input/Output mode) 0 Transmits and receives data on rising edge of SCLK0. Transmits and receives data on falling edge of SCLK0.
Cleared to 0 when read
1
Framing error flag Parity error flag Overrun error flag Parity additions enable 0 1 0 1 Disabled Enabled Odd parity Even parity
Even parity addition/check
Received data bit8
Note: As all error flags are cleared after reading do not test only a single bit with a bit-testing instruction.
Figure 3.9.11 Serial Control Register (Channel 0, SC0CR)
92C820-165
2007-02-16
TMP92C820
7
SC1CR (1209H) Bit symbol Read/Write After reset Function RB8 R Undefined Received data bit8
6
EVEN R/W 0 Parity 0: Odd 1: Even
5
PE 0 Parity addition 0: Disable 1: Enable
4
OERR 0 Overrun
3
PERR 0 1: Error Parity
2
FERR 0 Framing
1
SCLKS R/W 0 0: SCLK1
0
IOC 0 0: Baud rate generator 1: SCLK1 pin input
R (Cleared to 0 when read)
1: SCLK1
I/O interface input clock select 0 1 Baud rate generator SCLK1 pin input
Edge selection for SCLK pin (Input/Output mode) 0 Transmits and receives data on rising edge of SCLK1. Transmits and receives data on falling edge of SCLK1.
Cleared to 0 when read
1
Framing error flag Parity error flag Overrun error flag Parity additions enable 0 1 0 1 Disabled Enabled Odd parity Even parity
Even parity addition/check
Received data bit8 Note: As all error flags are cleared after reading do not test only a single bit with a bit-testing instruction.
Figure 3.9.12 Serial Control Register (Channel 1, SC1CR)
92C820-166
2007-02-16
TMP92C820
7
SC2CR (1211H) Bit symbol Read/Write After reset Function RB8 R Undefined Received data bit8
6
EVEN R/W 0 Parity 0: Odd 1: Even
5
PE 0 Parity addition 0: Disable 1: Enable
4
OERR 0 Overrun
3
PERR 0 1: Error Parity
2
FERR 0 Framing
1
-
0
-
R (Cleared to 0 when read) 0
R/W 0 Always write Always write "0". "0".
Framing error flag Parity error flag Overrun error flag Parity additions enable 0 1 0 1 Disabled Enabled Odd parity Even parity
Cleared to 0 when read
Even parity addition/check
Received data bit8
Note: As all error flags are cleared after reading do not test only a single bit with a bit-testing instruction.
Figure 3.9.13 Serial Control Register (Channel 2, SC2CR)
92C820-167
2007-02-16
TMP92C820
7
BR0CR (1203H) Bit symbol Read/Write After reset Function 0 Always write "0".
-
6
BR0ADDE 0
+ (16 - K)/16 division 0: Disable 1: Enable
5
BR0CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR0CK0 R/W 0
3
BR0S3 0
2
BR0S2 0
1
BR0S1 0
0
BR0S0 0
Divided frequency setting
+ (16 - K)/16 division enable
Setting the input clock of baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
0 1
Disable Enable
7
BR0ADD (1204H) Bit symbol Read/Write After reset Function
6
5
4
3
BR0K3 0
2
BR0K2 R/W 0
1
BR0K1 0
0
BR0K0 0
Sets frequency divisor "K" (divided by N + (16 - K)/16)
Sets baud rate generator frequency divisor BR0CR = 1 BR0CR BR0ADD 0000 0001 (K = 1) to 1111 (K = 15) Disable 0000 (N = 16) or 0010 (N = 2) to BR0CR = 0 0001 (N = 1) (UART only) to 1111 (N = 15) 0000 (N = 16)
0001 (N = 1) 1111 (N = 15) Disable Disable
Divided by N + (16 - K)/16
Divided by N
Note1: Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode
x
I/O mode
x x
The baud rate generator can be set to "1" in UART mode only when the +(16-K)/16 division function is not used. Do not use in I/O interface mode. Note2: Set BR0CR to 1 after setting K (K = 1 to 15) to BR0ADD when +(16-K)/16 division function is used. Writes to unused bits in the BR0ADD register do not affect operation, and undefined data is read from these unused bits.
Figure 3.9.14 Baud Rate Generator Control (Channel 0, BR0CR, BR0ADD)
92C820-168
2007-02-16
TMP92C820
7
BR1CR (120BH) Bit symbol Read/Write After reset Function 0 Always write "0".
-
6
BR1ADDE 0
+ (16 - K)/16 division 0: Disable 1: Enable
5
BR1CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR1CK0 R/W 0
3
BR1S3 0
2
BR1S2 0
1
BR1S1 0
0
BR1S0 0
Divided frequency setting
+ (16 - K)/16 division enable
Input clock selection for baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
0 1
Disabled Enabled
7
BR1ADD (120CH) Bit symbol Read/Write After reset Function
6
5
4
3
BR1K3 0
2
BR1K2 R/W 0
1
BR1K1 0
0
BR1K0 0
Set frequency divisor K (divided by N + (16 - K)/16)
Baud rate generator frequency divisor setting BR1CR = 1 BR1CR BR1ADD 0000 0001 (K = 1) to 1111 (K = 15) Disable 0000 (N = 16) or 0010 (N = 2) to BR1CR = 0 0001 (N = 1) (UART only) to 1111 (N = 15) 0000 (N = 16)
0001 (N = 1) 1111 (N = 15) Disable Disable
Divided by N + (16 - K)/16
Divided by N
Note1: Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode
x
I/O mode
x x
The baud rate generator can be set "1" in UART mode only when the +(16-K)/16 division function is not used. Do not use in I/O interface mode. Note2: Set BR1CR to 1 after setting K (K = 1 to 15) to BR1ADD when the +(16-K)/16 division function is used. Writes to unused bits in the BR1ADD register do not affect operation, and undefined data is read from these unused bits.
Figure 3.9.15 Baud Rate Generator Control (Channel 1, BR1CR, BR1ADD)
92C820-169
2007-02-16
TMP92C820
7
BR2CR (1213H) Bit symbol Read/Write After reset Function 0 Always write "0".
-
6
BR2ADDE 0
+ (16 - K)/16 division 0: Disable 1: Enable
5
BR2CK1 0 00: T0 01: T2 10: T8 11: T32
4
BR2CK0 R/W 0
3
BR2S3 0
2
BR2S2 0
1
BR2S1 0
0
BR2S0 0
Divided frequency setting
+ (16 - K)/16 division enable
Input clock selection for baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
0 1
Disabled Enabled
7
BR2ADD (1214H) Bit symbol Read/Write After reset Function
6
5
4
3
BR2K3 0
2
BR2K2 R/W 0
1
BR2K1 0
0
BR2K0 0
Set frequency divisor K (divided by N + (16 - K)/16)
Baud rate generator frequency divisor setting BR2CR = 1 BR2CR BR2ADD 0000 0001 (K = 1) to 1111 (K = 15) Disable 0000 (N = 16) or 0010 (N = 2) to BR2CR = 0 0001 (N = 1) (UART only) to 1111 (N = 15) 0000 (N = 16)
0001 (N = 1) 1111 (N = 15) Disable Disable
Divided by N + (16 - K)/16
Divided by N
Note1: Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode
x
I/O mode
x x
The baud rate generator can be set "1" in UART mode only when the +(16-K)/16 division function is not used. Do not use in I/O interface mode. Note2: Set BR2CR to 1 after setting K (K = 1 to 15) to BR2ADD when the +(16-K)/16 division function is used. Writes to unused bits in the BR2ADD register do not affect operation, and undefined data is read from these unused bits.
Figure 3.9.16 Baud Rate Generator Control (Channel 2, BR2CR, BR2ADD)
92C820-170
2007-02-16
TMP92C820
7 TB7 SC0BUF (1200H) 7 RB7
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0
(Transmission)
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0
(Receiving)
Note: Prohibit read-modify-write for SC0BUF.
Figure 3.9.17 Serial Transmission/Receiving Buffer Registers (Channel 0, SC0BUF) 7
SC0MOD1 Bit symbol (1205H) Read/Write After reset Function I2S0 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX0 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.18 Serial Mode Control Register 1 (Channel 0, SC0MOD1)
7 TB7 SC1BUF (1208H) 7 RB7 6 RB6 5 RB5 4 RB4 3 RB3 2 RB2 1 RB1 0 RB0 (Receiving) 6 TB6 5 TB5 4 TB4 3 TB3 2 TB2 1 TB1 0 TB0
(Transmission)
Note: Prohibit read-modify-write for SC1BUF.
Figure 3.9.19 Serial Transmission/Receiving Buffer Registers (Channel 1, SC1BUF) 7
SC1MOD1 Bit symbol (120DH) Read/Write After reset Function I2S1 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX1 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.20 Serial Mode Control Register 1 (Channel 1, SC1MOD1)
92C820-171
2007-02-16
TMP92C820
7 TB7 SC2BUF (1210H) 7 RB7
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0
(Transmission)
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0
(Receiving)
Note: Prohibit read-modify-write for SC1BUF.
Figure 3.9.21 Serial Transmission/Receiving Buffer Registers (Channel 2, SC2BUF) 7
SC2MOD1 Bit symbol (1215H) Read/Write After reset Function I2S2 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX2 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.22 Serial Mode Control Register 1 (Channel 2, SC2MOD1)
92C820-172
2007-02-16
TMP92C820 3.9.4 Operation in Each Mode
(1) Mode 0 (I/O interface mode) This mode allows an increase in the number of I/O pins available for transmitting data to or receiving data from an external shift register. This mode includes the SCLK output mode to output synchronous clock SCLK and SCLK input mode to input external synchronous clock SCLK.
Output extension TMP92C820 Shift register A B TXD SCLK Port SI SCK RCK C D E F G H Port S/ L SCLK CLOCK RXD QH Input extension TMP92C820 Shift register A B C D E F G H
TC74HC595 or equivalent
TC74HC165 or equivalent
Figure 3.9.23 SCLK Output Mode Connection Example
Output extension TMP92C820 Shift register A B TXD SCLK Port SI SCK RCK C D E F G H Port S/ L SCLK CLOCK RXD QH Input extension TMP92C820 Shift register A B C D E F G H
TC74HC595 or equivalent External clock
TC74HC165 or equivalent External clock
Figure 3.9.24 Example of SCLK Input Mode Connection
92C820-173
2007-02-16
TMP92C820
1. Transmission In SCLK output mode 8-bit data and a synchronous clock are output on the TXD0 and SCLK0 pins respectively each time the CPU writes the data to the transmission buffer. When all data is output, INTES0 will be set to generate the INTTX0 interrupt.
Timing to write transmisison data SCLK0 output ( = 0: Rising edge mode) SCLK0 output ( = 1: Falling edge mode) TXD0 ITX0C (INTTX0 interrupt request) Bit0 Bit1 Bit6 Bit7 (Internal clock timing)
Figure 3.9.25 Transmitting Operation in I/O Interface Mode (SCLK0 output mode) (Channel 0) In SCLK input mode, 8-bit data is output on the TXD0 pin when the SCLK0 input becomes active after the data has been written to the transmission buffer by the CPU. When all data is output, INTES0 will be set to generate INTTX0 interrupt.
SCLK0 input ( = 0: Rising edge mode) SCLK0 input ( = 1: Falling edge mode) TXD0 ITX0C (INTTX0 intterrupt request) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.26 Transmitting Operation in I/O Interface Mode (SCLK0 input mode) (Channel 0)
92C820-174
2007-02-16
TMP92C820
2. Receiving In SCLK output mode the synchronous clock is output on the SCLK0 pin and the data is shifted to receiving buffer 1. This is initiated when the receive interrupt flag INTES0 is cleared as the received data is read. When 8-bit data is received, the data is transferred to receiving buffer 2 (SC0BUF) following the timing shown below and INTES0 is set to 1 again, causing an INTRX0 interrupt to be generated. Setting SC0MOD0 to 1 initiates SCLK output.
IRX0C (INTRX0 interrupt request) SCLK0 output ( = 0: Rising edge mode) SCLK0 output ( = 1: Falling edge mode) RXD0 Bit0 Bit1 Bit6 Bit7
Figure 3.9.27 Receiving Operation in I/O Interface Mode (SCLK0 output mode) In SCLK input mode the data is shifted to receiving buffer 1 when the SCLK input goes active. The SCLK input goes active when the receive interrupt flag INTES0 is cleared as the received data is read. When 8-bit data is received, the data is shifted to receiving buffer 2 (SC0BUF) following the timing shown below and INTES0 is set to 1 again, causing an INTRX0 interrupt to be generated.
SCLK0 input ( = 0: Rising edge mode) SCLK0 input ( = 1: Falling edge mode) RXD1 IRX0C (INTRX0 intterrupt request) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.28 Receiving Operation in I/O Interface Mode (SCLK0 input mode)
Note: The system must be put in the receive enable state (SC0MOD0 = 1) before data can be received.
92C820-175
2007-02-16
TMP92C820
3. Transmission and receiving (Full duplex mode) When full duplex mode is used, set the receive interrupt level to 0 and set enable the level of transmit interrupt. Ensure that the program which transmits the interrupt reads the receiving buffer before setting the next transmit data. The following is an example of this:
Example: Channel 0, SCLK output Baud rate = 9600 bps fC = 4.9152 MHz
* Clock state
Clock gear 1/1 (fC)
Main routine 7 INTES0 PFCR PFFC SC0MOD0 SC0MOD1 SC0CR BR0CR SC0MOD0 SC0BUF 6 5 0 4 3 2 1 0 0
-
0 0 1
-
X 0
1X0
- - -
Set the INTTX0 level to 1. Set the INTRX0 level to 0. Set PF0, PF1, and PF2 to function as the TXD0, RXD0, and SCLK0 pins respectively. Enable receiving and select I/O interface mode. Select full duplex mode. SCLK output, transmit on negative edge, receive on positive edge. Baud rate = 9600 bps. Enable receiving. Set the transmit data and start.
X X - - 1 0 0 - * - -
1 0 0 0
- *
X X - X -
1X1
0 0 1
- *
1XXXXXX 0 0
- *
0 0 1
*
0 1
- *
0 0
- *
0 0
- *
INTTX0 interrupt routine Acc SC0BUF SC0BUF
* * * * * * * *
Read the receiving buffer. Set the next transmit data.
X: Don't care, -: No change
92C820-176
2007-02-16
TMP92C820
(2) Mode 1 (7-bit UART mode) 7-bit UART mode is selected by setting the serial channel mode register SC0MOD0 field to 01. In this mode a parity bit can be added. Use of a parity bit is enabled or disabled by the setting of the serial channel control register SC0CR bit; whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled).
Example: When transmitting data of the following format, the control registers should be set as described below. Start Bit0 1 2 3 4 5 6
Even parity
Stop
Transmission direction (Transmission rate: 2400 bps at fSYS = 39.3216 MHz)
* Clock state
Clock gear 1/1 (fC)
7 PFCR PFFC SC0MOD0 SC0CR BR0CR INTES0 SC0BUF
6
5
4
3
2
1
-
0 1 1 0 0
- *
X X - - - - X X - X - - - 0 - - 0 1 - 1 1 - - - 0 0 1 0 1 0 - * - *
X1 0 0 0
- *
Set PF0 to function as the TXD0 pin. Select 7-bit UART mode. Add even parity. Set the transfer rate to 2400 bps. Enable the INTTX0 interrupt and set it to interrupt level 4. Set data for transmission.
X 1 0 0 * * * * X: Don't care, -: No change
(3) Mode 2 (8-bit UART mode) 8-bit UART mode is selected by setting SC0MOD0 to 10. In this mode a parity bit can be added (Use of a parity bit is enabled or disabled by the setting of SC0CR); whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled).
Example: When receiving data of the following format, the control registers should be set as described below. Start Bit0 1 2 3 4 5 6
Odd parity
Stop
Transmission direction (Transmission rate: 9600 bps at fC = 39.3216 MHz)
* Clock state
Clock gear 1/1 (fC)
Main settings 7 PFCR SC0MOD0 SC0CR BR0CR INTES0 6 5 4
- - -
3
-
2
-
1 0 0 0 0 0
0
-
X X - - 0 1 - 0 1 0 -
Set PF1 to function as the RXD0 pin. Enable receiving in 8-bit UART mode. Add odd parity. Set the transfer rate to 9600 bps. Enable the INTRX0 interrupt and set it to interrupt level 4.
1
-
0
-
1 0 0 0
0
-
0
-
1
1
0
-X1
Interrupt processing Acc ( SC0CR AND 00011100 if Acc ( 0 then ERROR Acc ( SC0BUF X: Don't care, (: No change Check for errors. Read the received data.
92C820-177
2007-02-16
TMP92C820
(4) Mode 3 (9-bit UART mode) 9-bit UART mode is selected by setting SC0MOD0 to 11. In this mode parity bit cannot be added. In the case of transmission the MSB (9th bit) is written to SC0MOD0. In the case of receiving it is stored in SC0CR. When the buffer is written and read, the MSB is read or written first, before the rest of the SC0BUF data. Wakeup function In 9-bit UART mode, the wakeup function for slave controllers is enabled by setting SC0MOD0 to 1. The interrupt INTRX0 can only be generated when = 1.
TXD
RXD
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1
Slave 2
Slave 3
Note: The TXD pin of each slave controller must be in open-drain output mode.
Figure 3.9.29 Serial Link Using Wakeup Function
92C820-178
2007-02-16
TMP92C820
Protocol 1. 2. 3. Select 9-bit UART mode on the master and slave controllers. Set the SC0MOD0 bit on each slave controller to 1 to enable data receiving. The master controller transmits data one frame at a time. Each frame includes an 8-bit select code which identifies a slave controller. The MSB (Bit8) of the data () is set to 1.
Start Bit0 1 2 3 4 5 6 7 8 "1" Stop
Select code of slave controller
4.
Each slave controller receives the above frame. Each controller checks the above select code against its own select code. The controller whose code matches clears its bit to 0. The master controller transmits data to the specified slave controller (The controller whose SC0MOD0 bit has been cleared to 0). The MSB (Bit8) of the data () is cleared to 0.
Start Bit0 1 2 3 Data 4 5 6 7 Bit8 "0" Stop
5.
6.
The other slave controllers (whose bits remain at 1) ignore the received data because their MSBs (Bit8 or ) are set to 0, disabling INTRX0 interrupts. The slave controller whose bit = 0 can also transmit to the master controller. In this way it can signal the master controller that the data transmission from the master controller has been completed.
92C820-179
2007-02-16
TMP92C820
Example: To link two slave controllers serially with the master controller using the internal clock fIO as the transfer clock.
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1
Slave 2
Select code 00000001
Select code 00001010
Since serial channels 0 and 1 operate in exactly the same way, channel 0 only is used for the purposes of this explanation. *
Main 7 PFCR PFFC INTES0 SC0MOD0 SC0BUF 6 5 4 3 2 1 0 Set PF0 and PF1 to function as the TXD0 and RXD0 pins respectively. Enable the INTTX0 interrupt and set it to interrupt level 4. Enable the INTRX0 interrupt and set it to interrupt level 5.
1 0 X X - - - - 0 1 X X - X - - X 1 1 1 0 0 1 1 0 1
Setting the master controller
0 0
1 0
0 0
1 0
1 0
1 0
0 1
Set fIO as the transmission clock for 9-bit UART mode. Set the select code for slave controller 1.
INTTX0 interrupt SC0MOD0 SC0BUF
0 * - * - * - * - * - * - * - *
Set TB8 to 0. Set data for transmission.
*
Main
Setting the slave controller
7 PFCR PFFC INTES0 SC0MOD0
6
5
4
3
2
1
0 Select PF1 and PF0 to function as the RXD and TXD pins respectively (Open-drain output). Enable INTRX0 and INTTX0. Set to 1 in 9-bit UART transmission mode using fSYS as the transfer clock.
X X - - - - 0 0 X X - X - - X 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 1 0
INTRX0 interrupt Acc
SC0BUF
if Acc = select code Then SC0MOD0 - - - 0 - - - - -
Clear to 0.
92C820-180
2007-02-16
TMP92C820 3.9.5 Support for IrDA
SIO0 includes support for the IrDA 1.0 infrared data communication specification. Figure 3.9.30 shows the block diagram.
19H
Transmission data
IR modulator Modem
IR demodulator
TXD0
IR transmitter&LED IR output IR transceiver module
SIO0
Receive data
RXD0
IR receiver IR input
TMP92C820
Figure 3.9.30 Block Diagram (1) Modulation of the transmission data When the transmit data is 0, the modem outputs 1 to TXD0 pin with either 3/16 or 1/16 times for width of baud-rate. The pulse width is selected by the SIRCR. When the transmit data is 1, the modem outputs 0.
Transmission data TXD0 pin Start 0 1 0 0 1 1 0 0 Stop
Figure 3.9.31 Transmission Example (2) Modulation of the receive data When the receive data is the effective width of pulse "1", the modem outputs "0" to SIO0. Otherwise the modem outputs "1" to SIO0. The effective pulse width is selected by SIRCR.
Receiving pulse = "0" Receiving pulse = "1" Data after modulation Start 1 0 0 1 0 1 1 0 Stop
Figure 3.9.32 Receiving Example
92C820-181
2007-02-16
TMP92C820
(3) Data format The data format is fixed as follows: Data length: 8 bits Parity bits: None Stop bits: 1 (4) SFRs Figure 3.9.33 shows the control register SIRCR. Set the data SIRCR during SIO0 is stopping. The following example describes how to set this register:
20H
1) 2) 3) 4)
SIO setting
; Set the SIO to UART mode. ; Set the receive data pulse width to 16X. ; TXEN, RXEN enable the transmission and receiving. ; The modem operates as follows: SIO0 starts transmitting. IR receiver starts receiving.
LD LD
(SIRCR), 07H (SIRCR), 37H
Start transmission and receiving for SIO0
(5) Notes The IrDA 1.0 specification is defined in Table 3.9.4.
21H
1.
Making baud rate when using IrDA In baud rate during using IrDA, must set "01" to SC0MOD0 in SIO by using baud rate generator. TA0TRG, fIO, SCLK0 input can not using.
2.
Output pulse width and baud rate generator during transmission IrDA As the IrDA 1.0 physical layer specification, the data transfer speed and infra-red pulse width is specified. Table 3.9.4 Baud Rate and Pulse Width Specifications
Baud Rate
2.4 kbps 9.6 kbps 19.2 kbps 38.4 kbps 57.6 kbps 115.2 kbps
Modulation
RZI RZI RZI RZI RZI RZI
Rate Tolerance (% of rate)
0.87 0.87 0.87 0.87 0.87 0.87
Pulse Width Pulse Width Pulse Width (Minimum) (Typical) (Maximum)
1.41 s 1.41 s 1.41 s 1.41 s 1.41 s 1.41 s 78.13 s 19.53 s 9.77 s 4.88 s 3.26 s 1.63 s 88.55 s 22.13 s 11.07 s 5.96 s 4.34 s 2.23 s
The pulse width is defined either baud rate TX 3/16 or 1.6 s (1.6 s is equal to 3/16 pulse width when baud rate is 115.2 kbps). The TMP92C820 has the function selects the pulse width of transmission either 3/16 or 1/16. But 1/16 pulse width can be selected when the baud rate is equal or less than 38.4 kbps.
92C820-182
2007-02-16
TMP92C820
As the same reason, + (16 - k)/16 division function in the baud rate generator of SIO0 can not be used to generate 115.2 kbps baud rate. Also when the 38.4 kbps and 1/16 pulse width, + (16 - k)/16 division function can not be used. Table 3.9.5 Baud Rate and Pulse Width for (16 - k)/16 Division Function
Pulse Width 115.2 kbps
T x 3/16 T x 1/16
x -
Baud Rate 57.6 kbps 38.4 kbps 19.2 kbps 9.6 kbps 2.4 kbps
-
x



:
Can be used (16 - k)/16 division function
x: Can not be used (16 - k)/16 division function -: Can not be set to 1/16 pulse width
7
SIRCR (1207H) Bit symbol Read/Write After reset Function 0 PLSEL
6
RXSEL 0
5
TXEN 0 Transmit 0: Disable 1: Enable
4
RXEN R/W 0 Receive 0: Disable 1: Enable
3
SIRWD3 0
2
SIRWD2 0
1
SIRWD1 0
0
SIRWD0 0
Select Receive transmit data pulse width 0: "H" pulse 0: 3/16 1: "L" pulse 1: 1/16
Select receive pulse width Set effective pulse width for equal or more than 2x x (Value + 1) + 100ns Can be set: 1 to 14 Can not be set: 0, 15
Select receive pulse width Formula: Effective pulse width 2x x (Value + 1) + 100ns x = 1/fSYS 0000 0001 to 1110 1111 Cannot be set Disabled (Received input is ignored.) Enabled Disabled (Input from SIO is ignored.) Enabled 3/16 1/16 Receive operation 0 1 Can not be set Equal to or more than 4x + 100 ns Equal to or more than 30x + 100 ns
Transmit operation 0 1 0 1
Select transmit pulse width
Note: If a pulse width complying with the IrDA1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to "1" will result in result reduced power dissipation.
Figure 3.9.33 IrDA Control Register
92C820-183
2007-02-16
TMP92C820
3.10 Serial Bus Interface (SBI)
The TMP92C820 has 1-channel serial bus interface which employs a clocked-synchronous 8-bit SIO mode and an I2C bus mode. It is called SBI0. The serial bus interface is connected to an external device through P91 (SDA) and P92 (SCL) in the I2C bus mode; and through P90 (SCK), P91 (SO), P92 (SI) in the clocked-synchronous 8-bit SIO mode. Each pin is specified as follows.
P9ODE I C Bus Mode Clocked Synchronous 8-Bit SIO Mode
2
P9CR 11X 011 010
P9FC 11X 011 010 (Note)
11 XX
X: Don't care
Note : When using SI input function and SCK input function, set P9FC to "0" (Function setting).
3.10.1
Configuration
INTSBE0 interrupt request (Address/data) SCL SCK SIO clock control Input/ output control P90 (SCK)
T
Divider Transfer control circuit
SIO data control
SO SI
P91 (SO/SDA)
Noise canceller
I C bus clock sync. + control
2
Shift register
I C bus data control
2
P92 (SI/SCL) Noise canceller SDA
SBI0CR2/ SBI0SR SBI0 control register 2/ SBI0 status register
I2C0AR I C bus 0 address register
2
SBI0BR SBI0 data buffer register
SBI0CR1 SBI0 control register 1
SBI0BR0, 1 SBI0 baud rate register 0, 1
Figure 3.10.1 Serial Bus Interface 0 (SBI0)
92C820-184
2007-02-16
TMP92C820 3.10.2 Serial Bus Interface (SBI) Control
The following registers are used to control the serial bus interface and monitor the operation status. * * * * * * * Serial bus interface 0 control register 1 (SBI0CR1) Serial bus interface 0 control register 2 (SBI0CR2) Serial bus interface 0 data buffer register (SBI0DBR) I2C bus 0 address register (I2C0AR) Serial bus interface 0 status register (SBI0SR) Serial bus interface 0 baud rate register 0 (SBI0BR0) Serial bus interface 0 baud rate register 1 (SBI0BR1)
The above registers differ depending on a mode to be used. Refer to section 3.10.4 "I2C Bus Mode Control Register" and 3.10.7 "Clocked-synchronous 8-Bit SIO Mode Control".
3.10.3
The Data Formats in the I2C Bus Mode
The data formats in the I2C bus mode are shown below.
(a) Addressing format 8 bits S Slave address 1 (b) Addressing format (with restart) 8 bits S Slave address 1 1 RA /C WK 1 to 8 bits Data 1 or more 1 A CS K 8 bits Slave address 1 1 RA /C WK 1 to 8 bits Data 1 or more 1 A CP K 1 RA /C WK 1 to 8 bits Data 1 A C K 1 or more 1 to 8 bits Data 1 A CP K
(c) Free data format (data transferred from master device to slave device) 8 bits S Data 1 S: Start condition 1 A C K 1 to 8 bits Data 1 A C K 1 or more 1 to 8 bits Data 1 A CP K
R/ W : Direction bit ACK: Acknowledge bit P: Stop condition
Figure 3.10.2 Data Format in the I2C Bus Mode
92C820-185
2007-02-16
TMP92C820 3.10.4 I2C Bus Mode Control Register
The following registers are used to control and monitor the operation status when using the serial bus interface (SBI) in the I2C bus mode. Serial Bus Interface 0 Control Register 1 7
SBI0CR1 (1240H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function BC2
6
BC1 W
5
BC0 0
4
ACK R/W 0 Acknowledge mode specification 0: Not generate 1: Generate
3
2
SCK2 W
1
SCK1
0
SCK0/ SWRMON
R/W
0 0 Number of transferred bits (Note 1)
0 0 0/1 (Note 3) Internal serial clock selection and software reset monitor (Note 2)
Internal serial clock selection at write - (Note 4) 000 n=5 - (Note 4) 001 n=6 - (Note 4) 010 System clock: fSYS n=7 011 n = 8 75.8 kHz fSYS = 20 MHz (internal SCL output) 100 n = 9 38.5 kHz fSYS 101 n = 10 19.4 kHz fscl = n [Hz] 110 n = 11 9.73 kHz 2 +8 111 Reserved (Reserved) Software reset state monitor at read 0 1 During software reset Initial data
Acknowledge mode specification 0 1 Not generate clock pulse for acknowledge signal Generate clock pulse for acknowledge signal
Number of bits transferred = 0 Number of clock pulses 8 1 2 3 4 5 6 7 Bits 8 1 2 3 4 5 6 7 = 1 Number of clock pulses 9 2 3 4 5 6 7 8 Bits 8 1 2 3 4 5 6 7
000 001 010 011 100 101 110 111 Note 1: Note 2: Note 3:
Set the to "000" before switching to a clocked-synchronous 8-bit SIO mode. For the frequency of the SCL pin clock, see 3.10.5 (3) "Serial clock". Initial data of SCK0 is "0", SWRMON is "1".
2 2 2
Note 4: This I C bus circuit does not support Fast-mode, it supports the Standard mode only. Although the I C bus circuit itself allows the setting of a baud rate over 100kbps, the compliance with the I C specification is not guaranteed in that case.
Figure 3.10.3 Registers for the I2C Bus Mode
92C820-186
2007-02-16
TMP92C820
Serial Bus Interface 0 Control Register 2 7
SBI0CR2 (1243H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 Master/ slave selection 0 MST
6
TRX W
5
BB 0
4
PIN 1 Cancel INTSBE0 interrupt request
3
SBIM1 0 W (Note 1)
2
SBIM0 0
1
SWRST1 0 W (Note 1)
0
SWRST0 0
Transmitter/ Start/stop receiver condition selection generation
Serial bus interface operating mode selection (Note 2) 00: Port mode 01: SIO mode 2 10: I C bus mode 11: (Reserved)
Software reset generate write "10" and "01", then an internal software reset signal is generated.
Serial bus interface operating mode selection (Note 2) 00 Port mode (Serial bus interface output disabled) 01 Clocked-synchronous 8-bit SIO mode 10 I C bus mode 11 (Reserved) INTSBE0 interrupt request 0 1 - Cancel interrupt request
2
Start/stop condition generation 0 1 Generates the stop condition Generates the start condition
Transmitter/receiver selection 0 1 Receiver Transmitter
Master/slave selection 0 1 Slave Master
Note 1: Note 2:
Reading this register function as SBI0SR register. Switch a mode to port mode after confirming that the bus is free. Switch a mode between I C bus mode and clocked-synchronous 8-bit SIO mode after confirming that input signals via port are high level.
2
Figure 3.10.4 Registers for the I2C Bus Mode
92C820-187
2007-02-16
TMP92C820
Serial Bus Interface 0 Status Register 7
SBI0SR (1243H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 2 Master/ Transmitter/ I C bus slave status receiver status monitor status monitor monitor 1 INTSBE0 interrupt request monitor MST
6
TRX
5
BB
4
PIN R
3
AL 0 Arbitration lost detection monitor 0: -
2
AAS 0
Slave address match detection monitor
1
AD0 0
GENERAL CALL detection monitor
0
LRB 0 Last received bit monitor 0: "0"
1: Detected 1: Detected
0: Undetected 0: Undetected 1: "1" 1: Detected
Last received bit monitor 0 1 Last received bit was "0" Last received bit was "1"
GENERAL CALL detection monitor 0 1 Undetected GENERAL CALL detected
Slave address match detection monitor 0 1 Undetected Slave address match or GENERAL CALL detected
Arbitration lost detection monitor 0 1 - Arbitration lost
INTSBE0 interrupt request monitor 0 1
2
Interrupt requested Interrupt canceled
I C bus status monitor 0 1 Free Busy
Transmitter/receiver status monitor 0 1 Receiver Transmitter
Master/slave status monitor 0 1 Note: Writing in this register functions as SBI0CR2. Slave Master
Figure 3.10.5 Registers for the I2C Bus Mode
92C820-188
2007-02-16
TMP92C820
Serial Bus Interface 0 Baud Rate Register 0 7
SBI0BR0 (1244H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function - W 0 Always write "0".
6
I2SBI0 R/W 0 IDLE2 0: Stop 1: Run
5
4
3
2
1
0
Operation during IDLE2 mode 0 1 Stop Operation
Serial Bus Interface 0 Baud Rate Register 1 7
SBI0BR1 (1245H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function P4EN W 0 Internal clock 0: Stop 1: Operate
6
- W 0 Always write "0".
5
4
3
2
1
0
Baud rate clock control 0 1 Stop Operate
Serial Bus Interface 0 Data Buffer Register 7
SBI0DBR (1241H) Prohibit readmodifywrite Bit symbol Read/Write After reset Note 1: Note 2: DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Received)/W (Transfer) Undefined
When writing transmitted data, start from the MSB (Bit7). Receiving data is placed from LSB (Bit0). SBI0DBR can't be read the written data. Therefore read-modify-write instruction (e.g., "BIT" instruction) is prohibitted.
I2C Bus 0 Address Register 7
I2C0AR (1242H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0 0 0 SA6
6
SA5
5
SA4
4
SA3 W
3
SA2 0
2
SA1 0
1
SA0 0
0
ALS 0 Address recognition mode specification
Slave address selection for when device is operating as slave device
Address recognition mode specification 0 1 Slave address recognition Non slave address recognition
Figure 3.10.6 Registers for the I2C Bus Mode
92C820-189
2007-02-16
TMP92C820 3.10.5 Control in I2C Bus Mode
(1) Acknowledge mode specification Set the SBI0CR1 to "1" for operation in the acknowledge mode. The TMP92C820 generates an additional clock pulse for an acknowledge signal when operating in master mode. In the transmitter mode during the clock pulse cycle, the SDA pin is released in order to receive the acknowledge signal from the receiver. In the receiver mode during the clock pulse cycle, the SDA pin is set to the low in order to generate the acknowledge signal. Clear the to "0" for operation in the non-acknowledge mode. The TMP92C820 does not generate a clock pulse for the acknowledge signal when operating in the master mode. (2) Number of transfer bits Since the SBI0CR1 is cleared to "000" on start up, a slave address and direction bit transmissions are executed in 8 bits. Other than these, the retains a specified value. (3) Serial clock 1. Clock source The SBI0CR1 is used to specify the maximum transfer frequency for output on the SCL pin in the master mode. Set the baud rates, which have been calculated according to the formula below, to meet the specifications of the I2C bus, such as the smallest pulse width of tLOW.
tHIGH
tLOW
1/fscl
tLOW = 2 - /fSBI n1 tHIGH = 2 - /fSBI + 8/fSBI fscl = 1/(tLOW + tHIGH) = fnSBI 2 +8
n 1
Note:
fSBI is the clock fSYS.
SBI0CR1 000 001 010 011 100 101 110
n 5 6 7 8 9 10 11
Figure 3.10.7 Clock Source
92C820-190
2007-02-16
TMP92C820
2. Clock synchronization In the I2C bus mode, in order to wired-AND a bus, a master device which pulls down a clock pin to the low level, in the first place, invalidate a clock pulse of another master device which generates a high-level clock pulse. The master device with a high-level clock pulse needs to detect the situation and implement the following procedure. This device has a clock synchronization function which allows normal data transfer even when more than one master exists on the bus. The following example explains the clock synchronization procedures used when there are two masters present on the bus.
Wait counting high-level width of a clock pulse Start couting high-level width of a clock pulse Internal SCL output (Master A) Internal SCL output (Master B) SCL pin a b c
Reset a counter of high-level width of a clock pulse
Figure 3.10.8 Clock Synchronization When master A pulls the internal SCL output to the low level at point "a", the bus's SCL pin goes to the low level. After detecting this, master B resets a counter of high-level width of an own clock pulse and sets the internal SCL output the low level. Master A finishes counting low-level width of an own clock pulse at point "b" and sets the internal SCL output to the high level. Since master B is holding the bus's SCL pin the low level, master A waits for counting high-level width of an own clock pulse. After master B has finished counting low-level width of an own clock pulse at point "c" and master A detects the SCL pin of the bus at the high level, and starts counting high level of an own clock pulse. The clock pulse on the bus is determined by the master device with the shortest high-level width and the master device with the longest low-level width from among those master devices connected to the bus. (4) Slave address and address recognition mode specification When this device is to be used as a slave device, set the slave address and in I2C0AR. Clear the to "0" for the address recognition mode. (5) Master/slave selection To operate this device as a master device set the SBI0CR2 to "1". To operate it as a slave device clear the SBI0CR2 to "0". The is cleared to "0" in hardware when a stop condition is detected on the bus or when arbitration is lost.
92C820-191
2007-02-16
TMP92C820
(6) Transmitter/receiver selection To operate this device as a transmitter set the SBI0CR2 to "1". To operate it as a receiver clear the SBI0CR2 to "0". When data with an addressing format is transferred in the slave mode, when a slave address with the same value that an I2C0AR or a GENERAL CALL is received (All 8-bit data are "0" after a start condition), the is set to "1" in hardware if the direction bit ( R/ W ) sent from the master device is "1", and is cleared to "0" in hardware if the bit is "0". In the master mode, when an acknowledge signal is returned from the slave device, the is cleared to "0" in hardware if the value of the transmitted direction bit is "1", and is set to "1" in hardware if the value of the bit is "0". If an acknowledge signal is not returned, the current state is maintained. The is cleared to "0" in hardware when a stop condition is detected on the I2C bus or when arbitration is lost. (7) Start/stop condition generation When the SBI0SR = "0", slave address and direction bit which are set to SBI0DBR is output on the bus after generating a start condition by writing "1111" to the SBI0CR2. It is necessary to set transmitted data to the data buffer register (SBI0DBR) and set "1" to the beforehand.
SCL pin SDA pin Start condition
1 A6
2 A5
3 A4
4 A3
5 A2
6 A1
7 A0
8 R/ W
9
Slave address and the direction bit
Acknowledge signal
Figure 3.10.9 Start Condition Generation and Slave Address Generation When the SBI0SR = "1", the sequence for generating a stop condition can be initiated by writing "111" to the SBI0CR2 and writing "0" to the SBI0CR2. Do not modify the contents of the SBI0CR2 until a stop condition has been generated on the bus.
SCL pin SDA pin Stop condition
Figure 3.10.10 Stop Condition Generation The state of the bus can be ascertained by reading the contents of the SBI0SR. The SBI0SR will be set to "1" if a start condition has been detected on the bus, and will be cleared to "0" if a stop condition has been detected. Stop condition generation in master mode have limit. Therefore, please refer to 3.10.6 (4) "Stop condition generation".
92C820-192
2007-02-16
TMP92C820
(8) Interrupt service requests and interrupt cancellation When a serial bus interface interrupt request 0 by transfer of the slave address or the data (INTSBE0) is generated, the SBI0SR is cleared to "0". The SCL pin is pulled down to the low-level while the = "0". The is cleared to "0" when a single word of data is transmitted or received. Either writing data to or reading data from SBI0DBR sets the to "1". The time from the being set to "1" until the release of the SCL pin is tLOW. In the address recognition mode (e.g., when = "0"), the is cleared to "0" when the slave address matches the value set in I2C0AR or when a GENERAL CALL is received (All 8-bit data are "0" after a start condition). Although the SBI0CR2 can be set to "1" by a program, writing "0" to the SBI0CR2 does not clear it to "0". (9) Serial bus interface operation mode selection The SBI0CR2 is used to specify the serial bus interface operation mode. Set the SBI0CR2 to "10" when the device is to be used in I2C bus mode after confirming pin condition of serial bus interface to "H". Switch a mode to port after confirming a bus is free. (10) Arbitration lost detection monitor Since more than one master device can exist simultaneously on the bus in I2C bus mode, a bus arbitration procedure has been implemented in order to guarantee the integrity of transferred data. Data on the SDA pin is used for I2C bus arbitration. The following example illustrates the bus arbitration procedure when there are two master devices on the bus. Master A and master B output the same data until point "a". After master A outputs "L" and master B, "H", the SDA pin of the bus is wire-AND and the SDA pin is pulled down to the low level by master A. When the SCL pin of the bus is pulled up at point "b", the slave device reads the data on the SDA pin, that is, data in master A. Data transmitted from master B becomes invalid. The master B state is known as "ARBITRATION LOST". Master B device which loses arbitration releases the internal SDA output in order not to affect data transmitted from other masters with arbitration. When more than one master sends the same data at the first word, arbitration occurs continuously after the second word.
SCL pin Internal SDA output (Master A) Internal SDA output (Master B) SDA pin a b Internal SDA output becomes "1" after arbitration has been lost.
Figure 3.10.11 Arbitration Lost
92C820-193
2007-02-16
TMP92C820
This device compares the levels on the bus's SDA pin with those of the internal SDA output on the rising edge of the SCL pin. If the levels do not match, arbitration is lost and the SBI0SR is set to "1". When the is set to "1", the SBI0SR are cleared to "00" and the mode is switched to a slave receiver mode. Thus, clock output is stopped in data transfer after setting = "1". The is cleared to "0" when data is written to or read from SBI0DBR or when data is written to SBI0CR2.
Internal SCL output Internal SDA output Internal SCL output Internal SDA output 1 2 3 4 5 6 7 8 9 1 2 3 4
Master A
D7A
D6A
D5A
D4A
D3A
D2A
D1A
D0A
D7A' D6A' D5A' D4A'
Stop the clock pulse 1 2 3 4
Master B
D7B
D6B
Keep internal SDA output to high level as losing arbitration

Accessed to SBI0DBR or SBI0CR2
Figure 3.10.12 Example of a Master Device B (D7A = D7B, D6A = D6B) (11) Slave address match detection monitor The SBI0SR is set to "1" in the slave mode, in the address recognition mode (e.g., when the I2C0AR = "0"), when a GENERAL CALL is received, or when a slave address matches the value set in I2C0AR. When the I2C0AR = "1", the SBI0SR is set to "1" after the first word of data has been received. The SBI0SR is cleared to "0" when data is written to or read from the data buffer register SBI0DBR. (12) GENERAL CALL detection monitor The SBI0SR is set to "1" in the slave mode, when a GENERAL CALL is received (all 8-bit received data is "0", after a start condition). The SBI0SR is cleared to "0" when a start condition or stop condition is detected on the bus. (13) Last received bit monitor The value on the SDA pin detected on the rising edge of the SCL pin is stored in the SBI0SR. In the acknowledge mode, immediately after an INTSBE0 interrupt request has been generated, an acknowledge signal is read by reading the contents of the SBI0SR.
92C820-194
2007-02-16
TMP92C820
(14) Software reset function The software reset function is used to initialize the SBI circuit, when SBI is rocked by external noises, etc. An internal reset signal pulse can be generated by setting SBI0CR2 to "10" and "01". This initializes the SBI circuit internally. All command (except SBI0CR2) registers and status registers are initialized as well. The SBI0CR1 is automatically set to "1" after the SBI circuit has been initialized. (15) Serial bus interface data buffer register (SBI0DBR) The received data can be read and the transferred data can be written by reading or writing the SBI0DBR. When the start condition has been generated in the master mode, the slave address and the direction bit are set in this register. (16) I2C bus address register (I2C0AR) I2C0AR is used to set the slave address when this device functions as a slave device. The slave address output from the master device is recognized by setting I2C0AR is set to "0". The data format is the addressing format. When the slave address in not recognized at the is set to "1", the data format is the free data format. (17) Baud rate register (SBI0BR1) Write "1" to the SBI0BR1 before operation commences. (18) Setting register for IDLE2 mode operation (SBI0BR0) The setting of SBI0BR0 determines whether the device is operating or is stopped in IDLE2 mode. Therefore, setting is necessary before the HALT instruction is executed.
92C820-195
2007-02-16
TMP92C820 3.10.6 Data Transfer in I2C Bus Mode
(1) Device initialization Set the SBI0BR1 and the SBI0CR1. Set the SBI0BR1 to "1" and clear bits 7 to 5 and 3 of the SBI0CR1 to "0". Set a slave address in I2C0AR and the I2C0AR ( = "0" when an addressing format.) For specifying the default setting to a slave receiver mode, clear "000" to the , set "1" to the , set "10" to the and set "00" to the . (2) Start condition generation and slave address generation 1. Master mode In the master mode the start condition and the slave address are generated as follows. Check a bus free status (when = "0"). Set the SBI0CR1 to "1" (Acknowledge mode) and specify a slave address and a direction bit to be transmitted to the SBI0DBR. When the is "0", the start condition is generated by writing "1111" to the SBI0CR2. Subsequently to the start condition, 9 clocks are output from the SCL pin. While 8 clocks are output, the slave address and the direction bit which are set to the SBI0DBR. At the 9th clock pulse the SDA pin is released and the acknowledge signal is received from the slave device. An INTSBE0 interrupt request occurs on the falling edge of the 9th clock pulse. The is cleared to "0". In the master mode the SCL pin is pulled down to the low level while the is "0". When an INTSBE0 interrupt request occurs, the value of is changed according to the direction bit setting only if the slave device returns an acknowledge signal. 2. Slave mode In the slave mode the start condition and the slave address are received. After the start condition has been received from the master device, while 8 clocks are output from the SCL pin, the slave address and the direction bit which are output from the master device are received. When a GENERAL CALL or an address matching the slave address set in I2C0AR is received, the SDA pin is pulled down to the low level at the 9th clock pulse and an acknowledge signal is output. An INTSBE0 interrupt request occurs on the falling edge of the 9th clock pulse. The is cleared to "0". In the slave mode the SCL pin is pulled down to the low-level while the = "0". When an interrupt request occurs, the value of is changed according to the direction bit setting only if the slave device returns an acknowledge signal.
92C820-196
2007-02-16
TMP92C820
SCL pin SDA pin
1 A6 Start condition
2 A5
3 A4
4 A3
5 A2
6 A1
7 A0
8 R/ W
9 ACK Acknowledge signal from a slave device
Slave address + Direction bit
INTSBE0 interrupt request Output of master Output of slave
Figure 3.10.13 Start Condition Generation and Slave Address Transfer (3) 1-word data transfer Check the setting using an INTSBE0 interrupt process after the transfer of each word of data is completed and determine whether the device is in the master mode or the slave mode. 1. When the is "1" (Master mode) Check the setting and determine whether the device is in the transmitter mode or the receiver mode. When the is "1" (Transmitter mode) Check the setting. When the = "1", there is no receiver requesting data. Implement the process for generating a stop condition (See section 3.10.6 (4).) and terminate data transfer. When the = "0", the receiver is requesting new data. When the next transmitted data is 8 bits, write the transmitted data to the SBI0DBR. When the next transmitted data is other than 8 bits, set the , set the to "1" and write the transmitted data to the SBI0DBR. After the data has been written, the is set to "1", a serial clock pulse is generated to trigger transfer of the next word of data via the SCL pin, and the word is transmitted. After the data has been transmitted, an INTSBE0 interrupt request is generated. The is set to "0" and the SCL pin is pulled down to the low level. If the length of the data to be transferred is greater than one word, repeat the latter steps of the procedure, starting from the check of the setting.
SCL pin 1 2 3 4 5 6 7 8 9
Write to SBI0DBR SDA pin D7 D6 D5 D4 D3 D2 D1 D0 ACK Acknowledge signal from a receiver
INTSBE0 interrupt request Output from master Output from slave
Figure 3.10.14 Example in which = "000" and = "1" in Transmitter Mode
92C820-197
2007-02-16
TMP92C820
When the is "0" (Receiver mode) When the next transmitted data is other than 8 bits, set the again. Set the to "1" and read the received data from the SBI0DBR so as to release the SCL pin. (The value of data which is read immediately after a slave address is sent is undefined.) After the data has been read, the is set to "1". Serial clock pulse for transferring new 1 word of data is defined SCL and outputs "L" level from SDA pin with acknowledge timing. An INTSBE0 interrupt request is generated and the is set to "0". Then this device pulls down the SCL pin to the low level. This device outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that received data is read from SBI0DBR.
SCL pin 1 2 3 4 5 6 7 8 9
Read SBI0DBR SDA pin D7 D6 D5 D4 D3 D2 D1 D0 ACK New D7
Acknowledge signal to a transmitter INTSBE0 interrupt request Output from master Output from slave
Figure 3.10.15 Example of when = "000", = "1" in Receiver Mode In order to terminate the transmission of data to a transmitter, clear the to "0" before reading data which is 1 word before the last data to be received. The last data does not generate a clock pulse for the acknowledge signal. After the data has been transmitted and an interrupt request has been generated, set the to "001" and read the data. This device generates a clock pulse for a 1-bit data transfer. Since the master device is a receiver, the SDA pin on a bus keeps the high level. The transmitter receives the high-level signal as an ACK signal. The receiver indicates to the transmitter that data transfer is complete. After 1-bit data is received and an interrupt request has occurred, this device generates a stop condition (See section 3.10.6 (4).) and terminates data transfer.
SCL pin 9 1 2 3 4 5 6 7 8 1
SDA pin
D7
D6
D5
D4
D3
D2
D1
D0 Acknowledge signal sent to a transmitter
INTSBE0 interrupt request "0" read SBI0DBR Output of master Output of slave "001" read SBI0DBR
Figure 3.10.16 Termination of Data Transfer in Master Receiver Mode
92C820-198
2007-02-16
TMP92C820
2. When the is "0" (Slave mode) In the slave mode, this device operates either in normal slave mode or in slave mode after losing arbitration. In the slave mode, an INTSBE0 interrupt request occurs when this device receives a slave address or a GENERAL CALL from the master device, or when a GENERAL CALL is received and data transfer is complete, or after matching a received slave address. In the master mode, this device operates in a slave mode if it is losing arbitration. An INTSBE0 interrupt request occurs when word data transfer terminates after losing arbitration. When an INTSBE0 interrupt request occurs, the is cleared to "0", and the SCL pin is pulled down to the low level. Either reading data to or writing data from the SBI0DBR, or setting the to "1" releases the SCL pin after taking tLOW time. Check the SBI0SR, , , and and implements processes according to conditions listed in the next table.
92C820-199
2007-02-16
TMP92C820
Table 3.10.1 Operation in the Slave Mode
1

1

1 0
Conditions
This device loses arbitration when transmitting a slave address and receives a slave address of which the value of the direction bit sent from another master is "1". In the slave receiver mode, this device receives a slave address of which the value of the direction bit sent from the master is "1". In the slave transmitter mode, 1-word data is transmitted.
Process
Set the number of bits in 1 word to the and write the transmitted data to the SBI0DBR.
0
1
0
0
0
Check the . If the is set to "1", set the to "1" since the receiver does not request the next data. Then, clear the to "0" to release the bus. If the is cleared to "0", set the number of bits in a word to the and write transmitted data to the SBI0DBR since the receiver requests next data.
0
1
1
1/0
Read the SBI0DBR for setting the This device loses arbitration when to "1" (Reading dummy data) or set the transmitting a slave address and to "1". receives a GENERAL CALL or slave address of which the value of the direction bit sent from another master is "0". This device loses arbitration when transmitting a slave address or data and terminates transferring word data. In the slave receiver mode, this device receives a GENERAL CALL or slave address of which the value of the direction bit sent from the master is "0". In the slave receiver mode, the device terminates receiving 1-word data. Set the number of bits in a word to the and read received data from the SBI0DBR.
0
0
0
1
1/0
0
1/0
92C820-200
2007-02-16
TMP92C820
(4) Stop condition generation When the SBI0SR is "1", the sequence of generating a stop condition is started by setting "111" to the SBI0CR2 and "0" to the SBI0CR2. Do not modify the contents of the SBI0CR2 until a stop condition is generated on a bus. When a SCL pin of bus is pulled down by other devices, this device generates a stop condition after they release a SCL pin and the SDA becomes "1".
"1" "1" "0" "1" Internal SCL
Stop condition
SCL pin
SDA Pin
(Read)
Figure 3.10.17 Stop Condition Generation (Single master)
"1" "1" "0" "1" Internal SCL
The case of pulled low
Stop condition
SCL Pin
by another device
SDA Pin

(Read)
Figure 3.10.18 Stop Condition Generation (Multi master)
92C820-201
2007-02-16
TMP92C820
(5) Restart Restart is used during data transfer between a master device and a slave device to change the data transfer direction. The following description explains how to restart when this device is in the master mode. Clear the SBI0CR2 to "000" and set the SBI0CR2 to "1" to release the bus. The SDA line remains the high level and the SCL pin is released. Since a stop condition is not generated on the bus, other devices assume the bus to be in a busy state. Check the SBI0SR until it becomes "0" to check that the SCL pin of this device is released. Check the until it becomes 1 to check that the SCL line on a bus is not pulled down to the low level by other devices. After confirming that the bus stays in a free state, generate a start condition with procedure described in 3.10.6 (2). In order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to confirm that the bus is free until the time to generate the start condition.
"0" "0" "0" "1" "1" "1" "1" "1" 4.7 s (Min) SCL line Internal SCL output SDA line 9 Start condition
Figure 3.10.19 Timing Diagram when Restarting
92C820-202
2007-02-16
TMP92C820 3.10.7 Clocked-synchronous 8-Bit SIO Mode Control
The following registers are used to control and monitor the operation status when the serial bus interface (SBI) is being operated in clocked-synchronous 8-bit SIO mode. Serial Bus Interface 0 Control Register 1 7
SBI0CR1 (1240H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 0
Transfer start Continue/ abort transfer 0: Stop 0: Continue 1: Start transfer 1: Abort transfer
6
SIOINH W
5
SIOM1 0
4
SIOM0 0
3
2
SCK2 W 0
1
SCK1 0
0
SCK0 W 0
SIOS
Transfer mode select 00: Transmit mode 01: (Reserved) 10: Transmit/Receive mode 11: Receive mode
Serial clock selection and reset monitor
Serial clock selection at write 000 n = 4 1.25 MHz 001 n = 5 625 kHz System clock: fSYS 010 n = 6 313 kHz fSYS = 20 MHz (output to SCK pin) 011 n = 7 156 kHz fSYS 100 n = 8 78.1 kHz fscl = [Hz] n 101 n = 9 39.1 kHz 2 110 n = 10 19.5 kHz 111 - External clock: SCK0 Transfer mode selection 00 01 10 11 8-bit transmit mode (Reserved) 8-bit transmit/receive mode 8-bit receive mode
Continue/abort transfer 0 1 Continue transfer Abort transfer (Automatically cleared after transfer aborted)
Indicate transfer start/stop 0 1 Stop Start
Note: Set the transfer mode and the serial clock after setting to "0" and to "1".
Serial Bus Interface 0 Data Buffer Register 7
SBI0DBR (1241H) Bit symbol Read/Write DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receiver)/W (Transfer) Undefined
Prohibit After reset readmodify-write
Figure 3.10.20 Register for the SIO Mode
92C820-203
2007-02-16
TMP92C820
Serial Bus Interface 0 Control Register 2 7
SBI0CR2 (1243H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
5
4
3
SBIM1 W
2
SBIM0
1
- W 0 (Note 2)
0
- W 0 (Note 2)
0 0 Serial bus interface operation mode selection 00: Port mode 01: SIO mode 2 10: I C bus mode 11: (Reserved)
Note 1: Note 2:
Set the SBI0CR1 "000" before switching to a clocked-synchronous 8-bit SIO mode. Please always write "00" to SBICR2<1:0>.
Serial bus interface operation mode selection 00 Port mode (serial bus interface output disabled) 01 Clocked-synchronous 8-bit SIO mode 10 I C bus mode 11 (Reserved)
2
Serial Bus Interface 0 Status Register 7
SBI0SR (1243H) Bit symbol Read/Write After reset Function 0
6
5
4
3
SIOF R
2
SEF 0
1
0
Serial transfer Shift operation operation status monitor status monitor
Serial transfer operating status monitor 0 1 Transfer terminated Transfer in progress
Shift operation status monitor 0 1 Shift operation terminated Shift operation in progress
Serial Bus Interface 0 Baud Rate Register 0 7
SBI0BR0 (1244H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function - W 0 Always write "0".
6
- R/W 0 Always write "0".
5
4
3
2
1
0
Note: Clocked-synchronous mode cannot operate in IDLE2 mode.
Serial Bus Interface 0 Baud Rate Register 1 7
SBI0BR1 (1245H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function P4EN W 0 Internal clock 0: Stop 1: Operate Baud rate clock control 0 1 Stop Operate
6
- W 0 Always write "0".
5
4
3
2
1
0
Figure 3.10.21 Registers for the SIO Mode
92C820-204
2007-02-16
TMP92C820
(1) Serial clock 1. Clock source SBI0CR1 is used to select the following functions: Internal clock In an internal clock mode, any of seven frequencies can be selected. The serial clock is output to the outside on the SCK pin. When the device is writing (in the transmit mode) or reading (in the receive mode) data cannot follow the serial clock rate, an automatic wait function is executed to stop the serial clock automatically and holds the next shift operation until reading or writing is complete.
Automatic wait function
SCK0 pin output SO0 pin output Write transmitted data a
1
2
3
7
8
1
2
6
7
8
1
2 c1
3 c2
a0 a1 a2 a5 a6 a7
b0 b1 b4 b5 b6 b7 c 0 b c
Figure 3.10.22 Automatic Wait Function External clock ( = "111") An external clock input via the SCK pin is used as the serial clock. In order to ensure the integrity of shift operations, both the high and low-level serial clock pulse widths shown below must be maintained. The maximum data transfer frequency is 1.25 MHz (when fSYS = 20 MHz).
SCK0 pin tSCKL tSCKH tSCKL, tSCKH > 8 fSYS
Figure 3.10.23 Maximum Data Transfer Frequency when External Clock Input
92C820-205
2007-02-16
TMP92C820
2. Shift edge Data is transmitted on the leading edge of the clock and received on the trailing edge. (a) Leading edge shift Data is shifted on the leading edge of the serial clock (on the falling edge of the SCK pin input/output). (b) Trailing edge shift Data is shifted on the trailing edge of the serial clock (on the rising edge of the SCK pin input/output).
SCK pin output SO pin output Shift register
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7 *******7
76543210 *7654321 **765432 ***76543 ****7654 *****765 ******76
(a) Leading edge
SCK pin SI pin Shift register
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
********
0*******
10****** 210***** 3210**** 43210*** 543210** 6543210* 76543210
(b) Trailing edge *: Don't care
Figure 3.10.24 Shift Edge
92C820-206
2007-02-16
TMP92C820
(2) Transfer modes The SBI0CR1 is used to select a transmit, receive or transmit/receive mode. 1. 8-bit transmit mode Set a control register to a transmit mode and write transmission data to the SBI0DBR. After the transmit data has been written, set the SBI0CR1 to "1" to start data transfer. The transmitted data is transferred from the SBI0DBR to the shift register and output, starting with the least significant bit (LSB), via the SO pin and synchronized with the serial clock. When the transmission data has been transferred to the shift register, the SBI0DBR becomes empty. The INTSBE0 (Buffer empty) interrupt request is generated to request new data. When the internal clock is used, the serial clock will stop and the automatic wait function will be initiated if new data is not loaded to the data buffer register after the specified 8-bit data is transmitted. When new transmission data is written, the automatic wait function is canceled. When the external clock is used, data should be written to the SBI0DBR before new data is shifted. The transfer speed is determined by the maximum delay time between the time when an interrupt request is generated and the time when data is written to the SBI0DBR by the interrupt service program. When the transmit is started, after the SBI0SR goes "1" output from the SO pin holds final bit of the last data until falling edge of the SCK. Data transmission ends when the is cleared to "0" by the INTSBE0 interrupt service program or when the is set to "1". When the is cleared to "0", the transmitted mode ends when all data is output. In order to confirm whether data is being transmitted properly by the program, the (Bit3 of the SBI0SR) to be sensed. The SBI0SR is cleared to "0" when transmission has been completed. When the is set to "1", transmitting data stops. The turns "0". When the external clock is used, it is also necessary to clear the to "0" before new data is shifted; otherwise, dummy data is transmitted and operation ends.
92C820-207
2007-02-16
TMP92C820
Clear SCK pin (Output) SO pin INTSBE0 interrupt request SBI0DBR
a b * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Write transmitted data (a) Internal clock Clear SCK pin (Input) SO pin INTSBE0 interrupt request SBI0DBR
a b * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Write transmitted data (b) External clock
Figure 3.10.25 Transfer Mode Example: Program to stop data transmission (when an external clock is used)
STEST1: STEST2: BIT JR BIT JR LD 2, (SBI0SR) NZ, STEST1 0, (P9) Z, STEST2 (SBI0CR1), 00000111B ; 0 ; If SCK0 = 0 then loop ; If = 1 then loop
92C820-208
2007-02-16
TMP92C820
SCK pin SO pin
Bit6 Bit7
tSODH = 3.5/fSYS [s] (Min)
Figure 3.10.26 Transmitted Data Hold Time at End of Transmission 2. 8-bit receive mode Set the control register to receive mode and set the SBI0CR1 to "1" for switching to receive mode. Data is received into the shift register via the SI pin and synchronized with the serial clock, starting from the least significant bit (LSB). When the 8-bit data is received, the data is transferred from the shift register to the SBI0DBR. The INTSBE0 (Buffer full) interrupt request is generated to request that the received data be read. The data is then read from the SBI0DBR by the interrupt service program. When the internal clock is used, the serial clock will stop and the automatic wait function will be in effect until the received data is read from the SBI0DBR. When the external clock is used, since shift operation is synchronized with an external clock pulse, the received data should be read from the SBI0DBR before the next serial clock pulse is input. If the received data is not read, further data to be received is canceled. The maximum transfer speed when an external clock is used is determined by the delay time between the time when an interrupt request is generated and the time when the received data is read. Receiving of data ends when the is cleared to "0" by the INTSBE0 interrupt service program or when the is set to "1". If is cleared to "0", received data is transferred to the SBI0DBR in complete blocks. The received mode ends when the transfer is complete. In order to confirm whether data is being received properly by the program, the SBI0SR to be sensed. The is cleared to "0" when receiving is complete. When it is confirmed that receiving has been completed, the last data is read. When the is set to "1", data receiving stops. The is cleared to "0". (The received data becomes invalid, therefore no need to read it.) Note: When the transfer mode is changed, the contents of the SBI0DBR will be lost. If the mode must be changed, conclude data receiving by clearing the to "0", read the last data, then change the mode.
92C820-209
2007-02-16
TMP92C820
Clear SCK pin (Output) SI pin INTSBE0 interrupt request SBI0DBR
a b a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Read receiver data
Read receiver data
Figure 3.10.27 Receiver Mode (Example: Internal clock) 3. 8-bit transmit/receive mode Set a control register to a transmit/receive mode and write data to the SBI0DBR. After the data is written, set the SBI0CR to "1" to start transmitting/receiving. When data is transmitted, the data is output from the SO pin, starting from the least significant bit (LSB) and synchronized with the leading edge of the serial clock signal. When data is received, the data is input via the SI pin on the trailing edge of the serial clock signal. 8-bit data is transferred from the shift register to the SBI0DBR and the INTSBE0 interrupt request is generated. The interrupt service program reads the received data from the data buffer register and writes the data which is to be transmitted. The SBI0DBR is used for both transmitting and receiving. Transmitted data should always be written after received data is read. When the internal clock is used, the automatic wait function will be in effect until the received data is read and the next data is written. When the external clock is used, since the shift operation is synchronized with the external clock, the received data is read and transmitted data is written before a new shift operation is executed. The maximum transfer speed when the external clock is used is determined by the delay time between the time when an interrupt request is generated and the time at which received data is read and transmitted data is written. When the transmit is started, after the SBI0SR goes "1" output from the SO pin holds final bit of the last data until falling edge of the SCK. Transmitting/receiving data ends when the is cleared to "0" by the INTSBE0 interrupt service program or when the SBI0CR1 is set to "1". When the is cleared to "0", received data is transferred to the SBI0DBR in complete blocks. The transmit/receive mode ends when the transfer is complete. In order to confirm whether data is being transmitted/received properly by the program, set the SBI0SR to be sensed. The is set to "0" when transmitting/receiving is completed. When the is set to "1", data transmitting/receiving stops. The is then cleared to "0". Note: When the transfer mode is changed, the contents of the SBI0DBR will be lost. If the mode must be changed, conclude data transmitting/receiving by clearing the to "0", read the last data, then change the transfer mode.
92C820-210
2007-02-16
TMP92C820
Clear SCK pin (Output) SO pin SI pin INTSBE0 interrupt request SBI0DBR
a c b d * a0 c0 a1 c1 a2 c2 a3 c3 a4 c4 a5 c5 a6 c6 a7 c7 b0 d0 b1 d1 b2 d2 b3 d3 b4 d4 b5 d5 b6 d6 b7 d7
Write transmitted data (a)
Read received data (c)
Write transmitted data (b)
Read received data (d)
Figure 3.10.28 Transmit/Received Mode (Example: Internal clock)
SCK pin SO pin
Bit6 Bit7 in last transmitted word
tSODH = 4/fSYS [s] (Min)
Figure 3.10.29 Transmitted Data Hold Time at End of Transmit/Receive
92C820-211
2007-02-16
TMP92C820
3.11 Analog/Digital Converter
The TMP92C820 incorporates a 10-bit successive approximation-type analog/digital converter (AD converter) with 5-channel analog input. Figure 3.11.1 is a block diagram of the AD converter. The 5-channel analog input pins (AN0 to AN4) are shared with the input-only port (Port G) so they can be used as an input port.
0H
Note:
When IDLE2, IDLE1 or STOP mode is selected, as to reduce the power, with some timings the system may enter a standby mode even though the internal comparator is still enabled. Therefore be sure to check that AD converter operations are halted before a HALT instruction is executed.
Internal data bus
AD mode control register 1, 2
ADMOD1, ADMOD2

AD mode control register 0 ADMOD0

Scan Decoder Busy End Start Channel select Analog input AN4 (PG4) AN3/ADTRG (PG3) AN2 (PG2) AN1 (PG1) AN0 (PG0) Multiplexer Sample and hold AD Conversion result register ADREG0L to ADREG4L ADREG0H to ADREG4H Comparator AD Converter control circuit INTAD interrupt Repeat Interrupt ADTRG
VREFH VREFL DA converter
Figure 3.11.1 Block Diagram of AD Converter
92C820-212
2007-02-16
TMP92C820 3.11.1 Analog/Digital Converter Registers
The AD converter is controlled by the three AD mode control registers: ADMOD0, ADMOD1 and ADMOD2. The five AD conversion data result registers (ADREG0H/L to ADREG4H/L) store the results of AD conversion. Figure 3.11.2 shows the registers related to the AD converter.
1H
AD Mode Control Register 0 7
ADMOD0 (12B8H) Bit symbol Read/Write After reset Function 0 EOCF R 0 0 0
Always write "0".
6
ADBF
5
-
4
-
3
ITM0 R/W 0
2
REPEAT 0
1
SCAN 0
Scan mode specification
0
ADS 0
AD conversion start
AD conversion AD conversion Always write end flag busy flag "0". 0: Conversion 0: Conversion in progress stopped 1: Conversion 1: Conversion complete in progress
Interrupt Repeat mode specification specification in conversion 0: Single channel fixed conversion repeat mode 1: Repeat 0: Every conversion conversion mode 1: Every fourth conversion
0: Conversion 0: Don't care channel 1: Start fixed mode conversion 1: Conversion Always 0 channel when read scan mode
AD conversion start 0 1 Don't care Start AD conversion
Note: Always read as 0. AD scan mode setting 0 1 AD conversion channel fixed mode AD conversion channel scan mode
AD repeat mode setting 0 1 AD single conversion mode AD repeat conversion mode
Specify AD conversion interrupt for channel fixed repeat conversion mode Channel fixed repeat conversion mode = "0", = "1" 0 1 Generates interrupt every conversion. Generates interrupt every fourth conversion.
AD conversion busy flag 0 1 AD conversion stopped AD conversion in progress
AD conversion end flag 0 1 Before or during AD conversion AD conversion complete
Figure 3.11.2 AD Converter Related Register
92C820-213
2007-02-16
TMP92C820
AD Mode Control Register 1 7
ADMOD1 (12B9H) Bit symbol Read/Write After reset Function VREFON R/W 0
VREF application 0: OFF 1: ON
6
I2AD R/W 0
IDLE2 0: Stop 1: Operate
5
- 0
Always write "0".
4
- 0
Always write "0".
3
- R/W 0
Always write "0".
2
ADCH2 0
1
ADCH1 0
0
ADCH0 0
Analog input channel selection
Analog input channel selection 000 001 010 011 (Note) 100 (Note) 0 Channel fixed AN0 AN1 AN2 AN3 AN4 AN0 AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN0 AN1 AN2 AN3 AN4 1 Channel scanned
IDLE2 control 0 1 Stopped In operation
Control of application of reference voltage to AD converter 0 1 OFF ON
Before starting conversion (before writing 1 to ADMOD0), set the bit to 1.
AD Mode Control Register 2 7
ADMOD2 (12BAH) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
ADTRGE R/W 0
AD external trigger start control 0: Disable 1: Enable
AD conversion start control by external trigger ( ADTRG input) 0 1 Note: Disabled Enabled
As pin AN3 also function as the ADTRG input pin, do not set = "011, 100" when using ADTRG with set to "1".
Figure 3.11.3 AD Converter Related Register
92C820-214
2007-02-16
TMP92C820
AD Conversion Result Register 0 Low 7
ADREG0L (12A0H) Bit symbol Read/Write After reset Function ADR01 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR00
5
4
3
2
1
0
ADR0RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 0 High 7
ADREG0H Bit symbol (12A1H) Read/Write After reset Function ADR09
6
ADR08
5
ADR07
4
ADR06 R Undefined
3
ADR05
2
ADR04
1
ADR03
0
ADR02
Stores upper eight bits AD conversion result.
AD Conversion Result Register 1 Low 7
ADREG1L (12A2H) Bit symbol Read/Write After reset Function ADR11 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR10
5
4
3
2
1
0
ADR1RF R 0
AD conversion result flag 1: Conversion result stored
AD Conversion Result Register 1 High 7
ADREG1H Bit symbol (12A3H) Read/Write After reset Function 9 Channel x conversion result ADREGxH 765 ADREGxL 10 8 7 ADR19
6
ADR18
5
ADR17
4
ADR16 R Undefined
3
ADR15
2
ADR14
1
ADR13
0
ADR12
Stores upper eight bits of AD conversion result. 6 5 4 3 2 1 0
4
3
2
1
0
7
6
5
4
3
2
* Bits 5 to 1 are always read as 1. * Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.4 AD Converter Related Registers
92C820-215
2007-02-16
TMP92C820
AD Conversion Result Register 2 Low 7
ADREG2L (12A4H) Bit symbol Read/Write After reset Function ADR21 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR20
5
4
3
2
1
0
ADR2RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 2 High 7
ADREG2H Bit symbol (12A5H) Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R Undefined
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Stores upper eight bits of AD conversion result.
AD Conversion Result Register 3 Low 7
ADREG3L (12A6H) Bit symbol Read/Write After reset Function ADR31 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR30
5
4
3
2
1
0
ADR3RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 3 High 7
ADREG3H Bit symbol (12A7H) Read/Write After reset Function ADR39
6
ADR38
5
ADR37
4
ADR36 R Undefined
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Stores upper eight bits of AD conversion result.
9 Channel x conversion result
8
7
6
5
4
3
2
1
0
ADREGxH 765
4
3
2
1
0
7
6
5
4
3
2
ADREGxL 10
* Bits 5 to 1 are always read as 1. * Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.5 AD Converter Related Registers
92C820-216
2007-02-16
TMP92C820
AD Conversion Result Register 4 Low 7
ADREG4L (12A8H) Bit symbol Read/Write After reset Function ADR41 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR40
5
4
3
2
1
0
ADR4RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 4 High 7
ADREG4H Bit symbol (12A9H) Read/Write After reset Function ADR49
6
ADR48
5
ADR47
4
ADR46 R Undefined
3
ADR45
2
ADR44
1
ADR43
0
ADR42
Stores upper eight bits of AD conversion result.
9 Channel x conversion result
8
7
6
5
4
3
2
1
0
ADREGxH 765
4
3
2
1
0
7
6
5
4
3
2
ADREGxL 10
* Bits 5 to 1 are always read as 1. * Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.6 AD Converter Related Registers
92C820-217
2007-02-16
TMP92C820 3.11.2 Description of Operation
(1) Analog reference voltage A high-level analog reference voltage is applied to the VREFH pin; a low-level analog reference voltage is applied to the VREFL pin. To perform AD conversion, the reference voltage, the difference between VREFH and VREFL, is divided by 1024 using string resistance. The result of the division is then compared with the analog input voltage. To turn off the switch between VREFH and VREFL, write a 0 to ADMOD1 in AD mode control register 1. To start AD conversion in the OFF state, first write a 1 to ADMOD1, wait 3 s until the internal reference voltage stabilizes (This is not related to fc.), then set ADMOD0 to 1. (2) Analog input channel selection The analog input channel selection varies depends on the operation mode of the AD converter. * In analog input channel fixed mode (ADMOD0 = 0) Setting ADMOD1 selects one of the input pins AN0 to AN4 as the input channel. In analog input channel scan mode (ADMOD0 = 1) Setting ADMOD1 selects one of the five scan modes. Table 3.11.1 illustrates analog input channel selection in each operation mode.
2H
*
On a reset, ADMOD0 is set to 0 and ADMOD1 is initialized to 000. Thus pin AN0 is selected as the fixed input channel. Pins not used as analog input channels can be used as standard input port pins. Table 3.11.1 Analog Input Channel Selection
000 001 010 011 100
Channel Fixed = "0"
AN0 AN1 AN2 AN3 AN4 AN0
Channel Scan = "1"
AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN0 AN1 AN2 AN3 AN4
92C820-218
2007-02-16
TMP92C820
(3) Starting AD conversion To start AD conversion, write a 1 to ADMOD0 in AD mode control register "0" or ADMOD2 in AD mode control register 2, and input falling edge on ADTRG pin. When AD conversion starts, the AD conversion busy flag ADMOD0 will be set to 1, indicating that AD conversion is in progress. During A/D conversion, a falling edge input on the ADTRG pin will be ignored. (4) AD conversion modes and the AD conversion end interrupt The four AD conversion modes are: * * * * Channel fixed single conversion mode Channel scan single conversion mode Channel fixed repeat conversion mode Channel scan repeat conversion mode
The ADMOD0 and ADMOD0 settings in AD mode control register 0 determine the AD mode setting. Completion of AD conversion triggers an INTAD AD conversion end interrupt request. Also, ADMOD0 will be set to 1 to indicate that AD conversion has been completed. a. Channel fixed single conversion mode Setting ADMOD0 and ADMOD0 to 00 selects conversion channel fixed single conversion mode. In this mode data on one specified channel is converted once only. When the conversion has been completed, the ADMOD0 flag is set to 1, ADMOD0 is cleared to 0, and an INTAD interrupt request is generated. b. Channel scan single conversion mode Setting ADMOD0 and ADMOD0 to 01 selects conversion channel scan single conversion mode. In this mode data on the specified scan channels is converted once only. When scan conversion has been completed, ADMOD0 is set to 1, ADMOD0 is cleared to 0, and an INTAD interrupt request is generated.
92C820-219
2007-02-16
TMP92C820
c. Channel fixed repeat conversion mode Setting ADMOD0 and ADMOD0 to 10 selects conversion channel fixed repeat conversion mode. In this mode data on one specified channel is converted repeatedly. When conversion has been completed, ADMOD0 is set to 1 and ADMOD0 is not cleared to 0 but held at 1. INTAD interrupt request generation timing is determined by the setting of ADMOD0. Setting to 0 generates an interrupt request every time an AD conversion is completed. Setting to 1 generates an interrupt request on completion of every fourth conversion. d. Channel scan repeat conversion mode Setting ADMOD0 and ADMOD0 to 11 selects conversion channel scan repeat conversion mode. In this mode data on the specified scan channels is converted repeatedly. When each scan conversion has been completed, ADMOD0 is set to 1 and an INTAD interrupt request is generated. ADMOD0 is not cleared to 0 but held at 1. To stop conversion in a repeat conversion mode (e.g., in cases c. and d.), write a 0 to ADMOD0. After the current conversion has been completed, the repeat conversion mode terminates and ADMOD0 is cleared to 0. Switching to a halt state (IDLE2 mode with ADMOD1 cleared to 0, IDLE1 mode or STOP mode) immediately stops operation of the AD converter even when AD conversion is still in progress. In repeat conversion modes (e.g., in cases c. and d.), when the halt is released, conversion restarts from the beginning. In single conversion modes (e.g., in cases a. and b.), conversion does not restart when the halt is released (The converter remains stopped). Table 3.11.2 shows the relationship between the AD conversion modes and interrupt requests.
3H
Table 3.11.2 Relationship between AD Conversion Modes and Interrupt Requests Mode
Channel Fixed Single Conversion Mode Channel Scan Single Conversion Mode Channel Fixed Repeat Conversion Mode Channel Scan Repeat Conversion Mode
Interrupt Request Generation
After completion of conversion After completion of scan conversion Every conversion Every 4th conversion After completion of every scan conversion
ADMOD0
X X 0 1 X

0 0 1 1

0 1 0 1
X: Don't care
92C820-220
2007-02-16
TMP92C820
(5) AD conversion time 132 state (6.6 s at fSYS = 20 MHz) are required for the AD conversion of one channel. (6) Storing and reading the results of AD conversion The AD conversion data upper and lower registers (ADREG0H/L to ADREG4H/L) store the results of AD conversion. (ADREG0H/L to ADREG4H/L are read-only registers.) In channel fixed repeat conversion mode, the conversion results are stored successively in registers ADREG0H/L to ADREG3H/L. In other modes the AN0, AN1, AN2, AN3, AN4 conversion results are stored in ADREG0H/L, ADREG1H/L, ADREG2H/L, ADREG3H/L and ADREG4H/L respectively. Table 3.11.3 shows the correspondence between the analog input channels and the registers which are used to hold the results of AD conversion.
4H
Table 3.11.3 Correspondence between Analog Input Channels and AD Conversion Result Registers AD Conversion Result Register Analog Input Channel (Port G) Conversion Modes other than at Right
ADREG0H/L ADREG1H/L ADREG2H/L ADREG2H/L ADREG3H/L ADREG3H/L ADREG4H/L ADREG0H/L ADREG1H/L AN2 AN3 AN4
Channel Fixed Repeat Conversion Mode (=1)
AN0 AN1
, bit0 of the AD conversion data lower register, is used as the AD conversion data storage flag. The storage flag indicates whether the AD conversion result register has been read or not. When a conversion result is stored in the AD conversion result register, the flag is set to 1. When either of the AD conversion result registers (ADREGxH or ADREGxL) is read, the flag is cleared to 0. Reading the AD conversion result also clears the AD conversion end flag ADMOD0 to 0.
92C820-221
2007-02-16
TMP92C820
Setting example: 1. Convert the analog input voltage on the AN3 pin and write the result, to memory address 0800H using the AD interrupt (INTAD) processing routine.
Main routine: 7 INTE0AD ADMOD1 ADMOD0 1 1 - 6 1 1 - 5 0 0 0 4 0 0 0 3 - 0 0 2 - 0 0 1 - 1 0 0 - 1 1 Enable INTAD and set it to interrupt level 4. Set pin AN3 to be the analog input channel. Start conversion in channel fixed single conversion mode.
Interrupt routine processing example: WA WA (0800H) 2. ADREG3 >>6 WA Read value of ADREG3L and ADREG3H into 16-bit general-purpose register WA. Shift contents read into WA 6 times to right and zero-fill upper bits. Write contents of WA to memory address 0800H.
This example repeatedly converts the analog input voltages on the three pins AN0, AN1 and AN2, using channel scan repeat conversion mode. 1 1 0 1 0 0 0 0 - 0 0 - 0 1 - 1 1 - 0 1 Disable INTAD. Set pins AN0 to AN2 to be the analog input channels. Start conversion in channel scan repeat conversion mode.
INTE0AD ADMOD1
ADMOD0 - - 0 0 X: Don't care, (: No change
92C820-222
2007-02-16
TMP92C820
3.12 Watchdog Timer (Runaway detection timer)
The TMP92C820 contains a watchdog timer of runaway detecting. The watchdog timer (WDT) is used to return the CPU to the normal state when it detects that the CPU has started to malfunction (Runaway) due to causes such as noise. When the watchdog timer detects a malfunction, it generates a non-maskable interrupt INTWD to notify the CPU of the malfunction. Connecting the watchdog timer output to the reset pin internally forces a reset. (The level of external RESET pin is not changed.)
3.12.1
Configuration
Figure 3.12.1 is a block diagram of the watchdog timer (WDT).
0H
WDMOD
RESET
Reset control
Internal reset
INTWD interrupt
WDMOD 2 fIO
15
Selector 2
17
2
19
2
21
Binary counter (22 stages) Reset
Q R S
Internal reset Write 4EH Write B1H WDMOD
WDT control register WDCR
Internal data bus
Figure 3.12.1 Block Diagram of Watchdog Timer
Note: Care must be exercised in the overall design of the apparatus since the watchdog timer may fail to function correctly due to external noise, etc.
92C820-223
2007-02-16
TMP92C820 3.12.2 Operation
The watchdog timer generates an INTWD interrupt when the detection time set in the WDMOD has elapsed. The watchdog timer must be cleared to zero in software before an INTWD interrupt will be generated. If the CPU malfunctions (e.g., if runaway occurs) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter will overflow and an INTWD interrupt will be generated. The CPU will detect malfunction (runaway) due to the INTWD interrupt, and in this case it is possible to return the CPU to normal operation by means of an anti-malfunction program. The watchdog timer begins operating immediately on release of the watchdog timer reset. The watchdog timer is reset and halted in IDLE1 or STOP mode. The watchdog timer counter continues counting during bus release (when BUSAK goes low). When the device is in IDLE2 mode, the operation of the WDT depends on the WDMOD setting. Ensure that WDMOD is set before the device enters IDLE2 mode.
The watchdog timer consists of a 22-stage binary counter which uses the clock fSYS as the input clock. The binary counter can output 215/fIO, 217/fIO, 219/fIO and 221/fIO.
WDT counter WDT interrupt WDT clear (Software) Write clear code n Overflow 0
Figure 3.12.2 Normal Mode The runaway detection result can also be connected to the reset pin internally. In this case, the reset time will be between 44 and 58 system clocks (35.2 to 46.4s at fOSCH = 40 MHz) as shown in Figure 3.12.3. After a reset, the fIO clock (1 cycle = 1 state) is fFPH/4,
1H
where fFPH is generated by dividing the high-speed oscillator clock (fOSCH) by sixteen through the clock gear function
Overflow WDT counter WDT interrupt Internal reset 44 to 58 system clocks (35.2 to 46.4 s at fSYS = 20 MHz) n
Figure 3.12.3 Reset Mode
92C820-224
2007-02-16
TMP92C820 3.12.3 Control Registers
The watchdog timer WDT is controlled by two control registers WDMOD and WDCR. (1) Watchdog timer mode register (WDMOD) a. Setting the detection time for the watchdog timer in This 2-bit register is used for setting the watchdog timer interrupt time used when detecting runaway. On a reset this register is initialized to WDMOD = 00. The detection times for WDT is 215/fIO [s]. (The number of system clocks is approximately 65,536.) b. Watchdog timer enable/disable control register At reset, the WDMOD is initialized to 1, enabling the watchdog timer. To disable the watchdog timer, it is necessary to set this bit to 0 and to write the disable code (B1H) to the watchdog timer control register WDCR. This makes it difficult for the watchdog timer to be disabled by runaway. However, it is possible to return the watchdog timer from the disabled state to the enabled state merely by setting to 1. c. Watchdog timer out reset connection This register is used to connect the output of the watchdog timer with the RESET terminal internally. Since WDMOD is initialized to 0 at reset, a reset by the watchdog timer will not be performed. (2) Watchdog timer control register (WDCR) This register is used to disable and clear the binary counter for the watchdog timer. * Disable control The watchdog timer can be disabled by clearing WDMOD to 0 and then writing the disable code (B1H) to the WDCR register.
WDCR WDMOD WDCR 0 0 1 1 - 0 0 0 1 1 - 0 1 - 0 0 0 1 Write the clear code (4EH). Clear WDMOD to 0. Write the disable code (B1H). -X0 110
* *
Enable control Set WDMOD to 1. Watchdog timer clear control
To clear the binary counter and cause counting to resume, write the clear code (4EH) to the WDCR register.
WDCR 0 1 0 0 1 1 1 0 Write the clear code (4EH).
Note1: If the disable control is used, set the disable code (B1H) to WDCR after writing the clear code (4EH) once. (Please refer to setting example.) Note2: If the watchdog timer setting is changed, change setting after setting to disable condition once.
92C820-225
2007-02-16
TMP92C820
7
WDMOD (1300H) Bit symbol Read/Write After reset Function 1 WDT control 1: Enable WDTE
6
WDTP1 R/W 0 00: 2 /fIO 01: 2 /fIO 10: 2 /fIO 11: 2 /fIO
21 19 17 15
5
WDTP0 0
4
3
- 0 Always write "0".
2
I2WDT R/W 0 IDLE2 0: Stop 1: Operate
1
RESCR 0
0
- 0
Select detecting time
1: Internally Always connects write "0". WDT out to the reset pin
Watchdog timer out control 0 1 0 1 - Connects WDT out to a reset Stop Operation
IDLE2 control
Watchdog timer detection time 15 00 2 /fIO (Approximately 3.28 ms at fOSCH = 40 MHz) 17 01 2 /fIO (Approximately 13.1 ms at fOSCH = 40 MHz) 19 10 2 /fIO (Approximately 52.4 ms at fOSCH = 40 MHz) 21 11 2 /fIO (Approximately 210 ms at fOSCH = 40 MHz) Watchdog timer enable/disable control 0 1 Disabled Enabled
Figure 3.12.4 Watchdog Timer Mode Register 7
WDCR (1301H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function
6
5
4
- W -
3
2
1
0
B1H: WDT disable code 4EH: WDT clear code
WDT disable/clear control B1H 4EH Others Disable code Clear code -
Figure 3.12.5 Watchdog Timer Control Register
92C820-226
2007-02-16
TMP92C820
3.13 Real Time Clock (RTC)
3.13.1 Function Description for RTC
(1) Clock function (Hour, minute, second) (2) Calendar function (Month and day, day of the week, and leap year) (3) 24 or 12-hour (AM/PM) clock function (4) 30 second adjustment function (by software) (5) ALARM function (Alarm output) (6) Alarm interrupt generate (7) Divided power supply
3.13.2
Block Diagram
16 Hz clock 32 kHz clock Divider 1 Hz clock ALARM register
ALARM
Carry hold (1s)
ALARM select Comparator
ALARM
INTRTC
Clock
Address bus Adjust Read/Write control RD WR D0 to D7
DATA bus
Address
Figure 3.13.1 RTC Block Diagram Note 1: Western calendar year column: This product uses only the final two digits of the year. Therefore, the year following 99 is 00 years. In use, please take into account the first two digits when handling years in the western calendar. Note 2: Leap year: A leap year is divisible by 4, but the exception is any leap year which is divisible by 100; this is not considered a leap year. However, any year which is divisible by 400, is a leap year. This product does not take into account the above exceptions . Since this product accounts only for leap years divisible by 4, please adjust the system for any problems.
92C820-227
2007-02-16
TMP92C820 3.13.3 Detailed Explanation of Control Register
RTC is not initialized by system reset. Therefore, all registers must be initialized at the beginning of the program. (1) Second column register (for PAGE0 only) 7
SECR (1320H) Bit symbol Read/Write After reset Function "0" is read. 40 sec. column 20 sec. column 10 sec. column
6
SE6
5
SE5
4
SE4
3
SE3 R/W Undefined 8 sec. column
2
SE2
1
SE1
0
SE0
4 sec. column
2 sec. column
1 sec. column
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 1 1 1 1 0 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 sec 1 sec 2 sec 3 sec 4 sec 5 sec 6 sec 7 sec 8 sec 9 sec 10 sec 19 sec 20 sec 29 sec 30 sec 39 sec 40 sec 49 sec 50 sec 59 sec
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 Note: Do not set data other than as shown above.
92C820-228
2007-02-16
TMP92C820
(2) Minute column register (for PAGE0/1) 7
MINR (1321H) Bit symbol Read/Write After reset Function "0" is read. 40 min column 20 min column 10 min column
6
MI6
5
MI5
4
MI4
3
MI3 R/W Undefined 8 min column
2
MI2
1
MI1
0
MI0
4 min column
2 min column
1 min column
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 1 1 1 1 0 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 min 1 min 2 min 3 min 4 min 5 min 6 min 7 min 8 min 9 min 10 min 19 min 20 min 29 min 30 min 39 min 40 min 49 min 50 min 59 min
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 Note: Do not set data other than as shown above.
92C820-229
2007-02-16
TMP92C820
(3) Hour column register (for PAGE0/1) 1. In 24-hour clock mode (MONTHR = "1") 7
HOURR (1322H) Bit symbol Read/Write After reset Function "0" is read. 20 hours column 10 hours column 8 hours column
6
5
HO5
4
HO4
3
HO3 R/W Undefined
2
HO2
1
HO1
0
HO0
4 hours column
2 hours column
1 hour column
0 0 0 0 0 0 0 1 1
0 0 0 0 0 1 1 0 0
0 0 0
0 0 0
0 0 1 0 0 0 0 0 1
0 1 0 0 1 0 1 0 1
0 o'clock 1 o'clock 2 o'clock 8 o'clock 9 o'clock 10 o'clock 19 o'clock 20 o'clock 23 o'clock
:
1 1 0 0 0 0
:
1 0 0 0
:
0 0 Note: Do not set data other than as shown above.
2.
In 12-hour clock mode (MONTHR ="0") 7 6 5
HO5
4
HO4
3
HO3 R/W Undefined
2
HO2
1
HO1
0
HO0
HOURR (1322H)
Bit symbol Read/Write After reset Function "0" is read.
PM/AM
10 hours column
8 hours column
4 hours column
2 hours column
1 hour column
0 0 0 0 0 0 1 1
0 0 0 0 1 1 0 0
0 0 0 1 0 0 0 0
0 0 0 : 0 0 0 0 0
0 0 1 0 0 0 0 0
0 1 0 1 0 1 0 1
0 o'clock (AM) 1 o'clock 2 o'clock 9 o'clock 10 o'clock 11 o'clock 0 o'clock (PM) 1 o'clock
Note: Do not set data other than as shown above.
92C820-230
2007-02-16
TMP92C820
(4) Day of the week column register (for PAGE0/1) 7
DAYR (1323H) Bit symbol Read/Write After reset Function "0" is read. 0 0 0 0 1 1 1 W2 0 0 1 1 0 0 1
6
5
4
3
2
WE2
1
WE1 R/W Undefined W1 0 1 0 1 0 1 0
0
WE0
W0 Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Note: Do not set data other than as shown above.
(5) Day column register (PAGE0/1) 7
DATER (1324H) Bit symbol Read/Write After reset Function "0" is read. Day 20 0 0 0 0 0 0 0 0 0 1 1 1 1 Day 10 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 0 0 0 Day 8 0 0 0 0 1
6
5
DA5
4
DA4
3
DA3 R/W Undefined
2
DA2
1
DA1
0
DA0
Day 4 0 0 1 1 0 0 0 0 0 0 0 0 0
Day 2 0 1 0 1 0 1 0 1 1 0 1 0 1
Day 1 0 1st day 2nd day 3rd day 4th day 9th day 10th day 11th day 19th day 20th day 29th day 30th day 31st day
:
1 0 0 0 0 0
:
1 0 0 0
:
1 0 0 0 0 0
Note1: Do not set data other than as shown above. Note2: Do not set for non-existent days (e.g.: 30th Feb).
92C820-231
2007-02-16
TMP92C820
(6) Month column register (for PAGE0 only)
7 MONTHR (1325H) Bit symbol Read/Write After reset Function "0" is read. 10 months 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 8 months 0 0 0 1 1 1 1 0 0 0 0 0 6 5 4 MO4 3 MO4 2 MO2 R/W Undefined 4 months 0 1 1 0 0 1 1 0 0 0 0 1 2 months 1 0 1 0 1 0 1 0 1 0 1 0 1 month January February March April May June July August September October November December 1 MO1 0 MO0
Note: Do not set data other than as shown above.
(7) Select 24-hour clock or 12-hour clock (for PAGE1 only)
7 MONTHR (1325H) Bit symbol Read/Write After reset Function "0" is read. 6 5 4 3 2 1 0 MO0 R/W Undefined 1: 24-hour 0: 12-hour
92C820-232
2007-02-16
TMP92C820
(8) Year column register (for PAGE0 only) 7
YEARR (1326H) Bit symbol Read/Write After reset Function 80 years 40 years 20 years 10 years YE7
6
YE6
5
YE5
4
YE4 R/W Undefined
3
YE3
2
YE2
1
YE1
0
YE0
8 years
4 years
2 years
1 year
0 0 0 0 0 0 1
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 1
0 0 0 0 0 0 : 1
0 0 0 0 1 1 0
0 0 1 1 0 0 0
0 1 0 1 0 1 1
00 years 01 years 02 years 03 years 04 years 05 years 99 years
Note: Do not set data other than as shown above.
(9) Leap year register (for PAGE1 only)
7 YEARR (1326H) Bit symbol Read/Write After reset Function 6 5 4 3 2 1 LEAP1 R/W Undefined 00: Leap year 01: One year after leap year "0" is read. 10: Two years after leap year 11: Three years after leap year 0 LEAP0
0 0 1 1
0 1 0 1
Current year is a leap year Current year is the following a leap year year
Current year is two years after a leap year Current year is three years after a leap year
92C820-233
2007-02-16
TMP92C820
(10) Setting PAGE register (for PAGE0/1)
7 PAGER (1327H) Bit symbol Read/Write After reset
Read-modify-write Function instruction is prohibited.
6
5
4 ADJUST W Undefined 0: Don't care 1: Adjust
3 ENATMR R/W Undefined Clock 0: Disable 1: Enable
2 ENAALM
1
0 PAGE R/W Undefined
INTENA R/W 0 INTRTC 0: Disable 1: Enable "0" is read.
ALARM 0: Disable 1: Enable
PAGE "0" is read. selection
Note:
Please keep the setting order below of , and . Set different times for Clock/Alarm setting and interrupt setting.
(Example) Clock setting/Alarm setting ld ld (pager), 0ch (pager), 8ch : : Clock, Alarm enable Interrupt enable 0 1 0 1 Select Page0 Select Page1 Don't care Adjust sec. counter. When this bit is set to "1" the sec. counter becomes "0" when the value of the sec. counter is 0 - 29. When the value of the sec. counter is 30-59, the min. counter is carried and sec. counter becomes "0". Output Adjust signal during 1 cycle of fSYS. After being adjusted once, Adjust is released automatically. (PAGE0 only)
PAGE
ADJUST
(11) Setting reset register (for PAGE0/1)
7 RESTR (1328H) Bit symbol Read/Write 1Hz 0: Enable 1: Disable 16Hz 0: Enable 1: Disable 1:Clock reset 1: Alarm reset DIS1Hz 6 DIS16Hz 5 RSTTMR 4 RSTALM W Undefined Always write "0" 3 2 1 0
-
-
-
-
Read-modify After reset write-instructio Function n is prohibited.
RSTALM
0 1 0 1
Unused Reset alarm register Unused Reset counter (PAGER) 1 0 0
RSTTMR
1 0 1
1 1 0 Others
Source signal Alarm 1Hz 16Hz Output "0"
92C820-234
2007-02-16
TMP92C820 3.13.4 Operational description
(1) Reading clock data 1. Using 1Hz interrupt 1Hz interrupt and the count up of internal data synchronize. Therefore, data can read correctly if reading data after 1Hz interrupt occurred. 2. Using two times reading There is a possibility of incorrect clock data reading when the internal counter carries over. To ensure correct data reading, please read twice, as follows:
Start
PAGER = "0" , Select PAGE0
Read the clock data (1st)
Read the clock data (2nd)
NO 1st data = 2nd data YES END
Figure 3.13.2 Flowchart of clock data read
92C820-235
2007-02-16
TMP92C820
(2) Writing clock data When a carry over occurs during a write operation, the data cannot be written correctly. Please use the following method to ensure data is written correctly. 1. Using 1Hz interrupt 1Hz interrupt and the count up of internal data synchronize. Therefore, data can write correctly if writing data after 1Hz interrupt occurred. 2. Resetting a counter There are 15-stage counter inside the RTC, which generate a 1Hz clock from 32,768 KHz. The data is written after reset this counter. However, if clearing the counter, it is counted up only first writing at half of the setting time, first writing only. Therefore, if setting the clock counter correctly, after clearing the counter, set the 1Hz-interrupt to enable. And set the time after the first interrupt (occurs at 0.5Hz) is occurred.
Start PAGER = "0" , Select PAGE0
RESTR = "1" reset counter
RESTR = "0" enable 1Hz interrupt
First interrupts occur (After 0.5S) YES Sets the time
NO
END
Figure 3.13.3 Flowchart of data write
92C820-236
2007-02-16
TMP92C820
2.
Disabling the clock A clock carry over is prohibited when "0" is written to PAGER in order to prevent malfunction caused by the Carry hold circuit. While the clock is prohibited, the Carry hold circuit holds a one sec. carry signal from a divider. When the clock becomes enabled, the carry signal is output to the clock, the time is revised and operation continues. However, the clock is delayed when clock-disabled state continues for one second or more. Note that at this time system power is down while the clock is disabled. . In this case the clock is stopped and clock is delayed.
Start
Disable the clock
Read the clock data
Enable the clock
End
Figure 3.13.4 Flowchart of Clock disable
92C820-237
2007-02-16
TMP92C820 3.13.5 Explanation of the interrupt signal and alarm signal
The alarm function used by setting the PAGE1 register and outputting either of the following three signals from ALARM pin by writing "1" to PAGER. INTRTC outputs a 1-shot pulse when the falling edge is detected. RTC is not initialized by RESET. Therefore, when the clock or alarm function is used, clear interrupt request flag in INTC (interrupt controller). (1) When the alarm register and the clock correspond, output "0". (2) 1Hz Output clock . (3) 16Hz Output clock. (1) When the alarm register and the clock correspond, output "0" When PAGER= "1", and the value of PAGE0 clock corresponds with PAGE1 alarm register, output "0" to ALARM pin and generate INTRTC. The methods for using the alarm are as follows: Initialization of alarm is done by writing "1" to RESTR. All alarm settings become Don't care. In this case, the alarm always corresponds with value of the clock, and if PAGER is "1", INTRTC interrupt request is generated. Setting alarm min., alarm hour, alarm date and alarm day is done by writing data to the relevant PAGE1 register. When all setting contents correspond, RTC generates an INTRTC interrupt if PAGER is "1". However, contents which have not been set up (don't care state) are always considered to correspond. Contents which have already been set up, cannot be returned independently to the Don't care state. In this case, the alarm must be initialized and alarm register reset. The following is an example program for outputting an alarm from ALARM -pin at noon (PM12:00) every day.
LD LD LD LD LD LD LD ( LD (PAGER), 09H (RESTR), D0H (DAYR), 01H (DATAR),01H (HOURR), 12H (MINR), 00H (PAGER), 0CH (PAGER), 8CH ; ; ; ; ; ; ; ; Alarm disable, setting PAGE1 Alarm initialize W0 1 day Setting 12 o'clock Setting 00 min Set up time 31 s (Note) Alarm enable Interrupt enable )
When the CPU is operating at high frequency oscillation, it may take a maximum of one clock at 32 kHz (about 30us) for the time register setting to become valid. In the above example, it is necessary to set 31us of set up time between setting the time register and enabling the alarm register.
Note: This set up time is unnecessary when you use only internal interruption.
92C820-238
2007-02-16
TMP92C820
(2) With 1Hz output clock RTC outputs a clock of 1Hz to ALARM pin by setting up PAGER= "0", RESTR= "0", = "1". RTC also generates an INTRC interrupt on the falling edge of the clock. (3) With 16Hz output clock RTC outputs a clock of 16Hz to ALARM pin by setting up PAGER= "0", RESTR= "1", = "0". RTC also generates INTRC an interrupt on the falling edge of the clock.
92C820-239
2007-02-16
TMP92C820
3.14 LCD Controller (LCDC)
The TMP92C820 incorporates two types liquid crystal display driving circuit for controlling LCD driver LSI. One circuit handles a RAM built-in type LCD driver that can store display data in the LCD driver itself, and the other circuit handles a shift-register type LCD driver that must serially transfer the display data to LCD driver for each display picture. * Shift-register type LCD driver control mode (SR mode) Set the mode of operation, start address of source data save memory and LCD size to control register before setting start register. After set start register LCDC outputs bus release request to CPU and read data from source memory. After that LCDC transmits data of volume of LCD size to external LCD driver through data bus. At this time, control signals connected LCD driver output specified waveform synchronizes with data transmission. After finish data transmission, LCDC cancels the bus release request and CPU will re-start. As the DISPLAY RAM, SDRAM burst mode can be used in TMP92C820. * RAM built-in type LCD driver control mode (RAM mode) Data transmission to LCD driver is executed by move instruction of CPU. After setting mode of operation to control register, when moves instruction of CPU is executed, LCDC outputs chip select signal to LCD driver connected to the outside from control pin (D1BSCP etc). Therefore control of data transmission numbers corresponding to LCD size is controlled by instruction of CPU. This section is constituted as follows. 3.14.1 Feature of LCDC of Each Mode 3.14.2 Block Diagram 3.14.3 SFRs 3.14.4 Shift Register Type LCD Driver Control Mode (SR mode) 3.14.4.1 Operation 3.14.4.2 Grayscale Mode Indication 3.14.4.3 Memory Mapping 3.14.4.4 Hardware Cursor 3.14.4.5 Frame Signal Settlement 3.14.4.6 Timing Charts of Interpreting Memory Codes 3.14.4.7 Examples to Use 3.14.4.8 Sample Program 3.14.5 RAM Built-in Type LCD Driver Control Mode (RAM mode) 3.14.5.1 Operation 3.14.5.2 Examples to Use 3.14.5.3 Sample Program
92C820-240
2007-02-16
TMP92C820 3.14.1 Feature of LCDC of Each Mode
Each feature and operation of pin is as follows. Table 3.14.1 Feature of LCDC of Each Mode Shift-register Type LCD Driver Control Mode
Common (Row): The number of picture elements can be handled Transfer data bus width Internal RAM Transfer rate (at fSYS = 20 [MHz]) LCD data bus: LD7 to LD0 pin Data bus: D7 to D0 pin Bus state: R/W pin Segment (Column): 32 bits or 16 bits Not allow to use 50 ns/1 word at SDRAM/BURST 100 ns/1 word at SRAM Data bus: Connect to data input pin of column driver. Not used Not used 128, 160, 200, 240, 320, 400, 480 128, 160, 240, 320, 400, 480, 560, 640
RAM Built-in Type LCD Driver Control Mode
There is not a limitation
8 bits fixed Allow to use - Not used Data bus: Connect to data input pin of LCD driver. Bus state: Connect with /WR pin of column/row driver. Address 0: Connect with D/I pin of column driver. When A0 = 1 data bus value means display data, when A0 = 0 data bus means instruction data. Chip enable for column driver 1: Connect with CE pin of column driver 1.
Address bus: A0 pin
Not used
External pins
Shift clock pulse: D1BSCP pin
Shift clock pulses: Connect with SCP pin of column driver. LCD driver latches data bus value by falling edge of this pin.
Latch pulse: D2BLP pin
Latch pulses output: Connect with LP/EIO1 pin of column/row driver. Display data is Chip enable for column driver 2: latched in 1st shift register in LCD driver by Connect with CE pin of column driver 2. rising edge of this pin. And shift to next shift register by LP and SCP = "H". LCD frame output: Connect with FR pin of column/row driver. Cascade pulses output: Connect with DIO1 pin of row driver. These pin outputs 1 shot pulse by every D3BFR pin changes. Chip enable for column driver 3: Connect with CE pin of column driver 3. Chip enable for row driver: Connect with LE pin of row driver.
Frame: D3BFR pin Cascade pulse: DLEBCD pin Display OFF: DOFF pin
Display OFF output: Connect with DSPOF terminal of column/row driver. "L" means display off and "H" means display ON.
92C820-241
2007-02-16
TMP92C820 3.14.2 Block Diagram
Selector CPU address bus: A0 to A23 MMU External data bus: A0 to A23 External data bus: D0 to D15
Gray scale control
COLUMN INCREMENTOR
ROW INCREMENTOR
Clear GLCDC address bus Cursor control
System clock: fSYS CPU BUSAK output
InnerSCP generate
COLUMN counter (9 bits)
COLUMN END R S Q
COLUMN register
Comparator
SCPEN
BUSRQ
Internal I/O data bus
To internal INT (Rising edge)

Lower rate clock: fs TA3OUT
Shift register increment (14 bits) ROW register LP generate
LP output circuit
External D2BLP
Internal I/O data bus
BCD generate FP register ROW counter DVM register 1 DVM register 2 FR generate FR driver FR driver
External DLEBCD
External D3BFR
fSYS
2x, 4x, 8x clock divider
80 bytes FIFO and SCP generator
LCD bus LD0 to LD7
D1BSCP
Figure 3.14.1 LCDC Block Diagram
92C820-242
2007-02-16
TMP92C820 3.14.3 SFRs
LCDMODE Register 7
LCDMODE Bit symbol (0200H) Read/Write After reset Function BAE R/W 0 B-area 0: Disable 1: Enable
6
AAE R/W 0 A-area 0: Disable 1: Enable
5
SCPW1 R/W 1 00: Base SCP 01: 2 clocks 10: 4 clocks 11: 8 clocks
4
SCPW0 R/W 0
3
TA3LCDCK
2
BULK R/W 0 Bytenumber/ Common 0: 512 bytes 1: 1024 bytes * (Note 4)
1
RAMTYPE R/W 0 Display RAM 0: SRAM 1: SDRAM
0
MODE R/W 0 Mode selection 0: RAM 1: SR
R/W 0 Select lowfrequency clock 0: 32 kHz 1: TA3OUT
Note 1:
is effective when is set to "1". shows how to generate address for next common.
Note 2: Note 3: Note 4:
The SDRAM accessing way of LCDC is only "Burst 1CLK access". Base SCPW<1:0> is introduced in section. 3.14.4.6. Refer to Table 3.14.1.
0H
Table 3.14.2 SDRAM BULK and Column Address LCDMODE
SDRAMC SDACR Bulk of 1 page
0
Type A 512 bytes
1
Type B 1024 bytes
Divide FRM Register 7
LCDDVM (0201H) Bit symbol Read/Write After reset Function 0 0 0 0 FMN7
6
FMN6
5
FMN5
4
FMN4 R/W
3
FMN3 0
2
FMN2 0
1
FMN1 0
0
FMN0 0
Setting DVM bit7 to 0
LCD Size Setting Register 7
LCDSIZE (0202H) Bit symbol Read/Write After reset Function COM3 R/W 0 0000: 128 0001: 160 0010: 200 0011: 240 0100: 320 Other: Reserved
6
COM2 R/W 0 0101: 400 0110: 480
5
COM1 R/W 0
4
COM0 R/W 0
3
SEG3 R/W 0 0000: 128 0001: 160 0010: 240 0011: 320 0100: 400
2
SEG2 R/W 0 0101: 480 0110: 560 0111: 640 Other: Reserved
1
SEG1 R/W 0
0
SEG0 R/W 0
Setting the LCD common number for SR mode
Setting the LCD segment number for SR mode
92C820-243
2007-02-16
TMP92C820
LCD Control Register 7
LCDCTL (0203H) Bit symbol Read/Write After reset Function LCDON R/W 0
DOFF port
6
ALL0 R/W 0 LD bus output control 0: Normal 1: All display data = 0
5
FRMON R/W 0 Divided FR mode 0: Disable 1: Enable
4
- R/W 0 Always write "0".
3
FP9 R/W 0 Setting bit9 for fFP [9:0]
2
MMULCD R/W 0
Type selection of LCD driver with built-in RAM 0: Sequential access type 1: Random access type
1
FP8 R/W 0 Setting bit8 for fFP [9:0]
0
START R/W 0 Start control in SR mode 0: Stop 1: Start
0: OFF 1: ON
LCDC start/stop bit 0 1 0 1 0 1 0 1 LCDC stop LCDC start Sequential access type Random access type Disable Enable Normal All "0" writing "1" that data transfer to LCDD. Usually, writing "0". Pin of LCD driver: DOFF 0 1 Driver OFF Driver ON Case of "0": output "0" Case of "1": output "1"
RAM internal LCD driver TYPE selection
Flame frequency division mode
LD bus output control
Note: This bit is forced setting it to "0" (light OFF) by
Note: This bit decide state of DOFF pin.
Figure 3.14.2 LCDC Control Register 1
92C820-244
2007-02-16
TMP92C820
LCD fFP Register 7
LCDFFP (0204H) Bit symbol Read/Write After reset Function 0 0 0 0 FP7
6
FP6
5
FP5
4
FP4 R/W
3
FP3 0
2
FP2 0
1
FP1 0
0
FP0 0
Setting bit7 to 0 for fFP
LCD Gray Level Setting Register 7
LCDGL (0205H) Bit symbol Read/Write After reset Function 0 00: Monochrome 01: 4 levels 10: 8 levels 11: 16 levels
6
5
4
3
2
1
GRAY1 R/W
0
GRAY0 0
Figure 3.14.3 LCDC Control Register 2 Table 3.14.3 LCD Start/End Address Register
Start Address Register H LSARAH (0211H) 40H LSARBH (0215H) 40H LSARCH (021AH) 40H M LSARAM (0210H) 00H LSARBM (0214H) 00H LSARCM (0219H) 00H L H LEARAH (0213H) 40H LEARBH (0217H) 40H - - End Address Register M LEARAM (0212H) 00H LEARBM (0216H) 00H - - L
(Bit23 to Bit16) (Bit15 to Bit8) (Bit7 to Bit0) (Bit23 to Bit16) (Bit15 to Bit8) (Bit7 to Bit0) A-area After reset B-area After reset C-area After reset - - - - LSARCL (0218H) 00H - - - - - -
Note: All registers are available for R (Read)/W (Write).
92C820-245
2007-02-16
TMP92C820
LCD Cursor Setting Register 7
LCDCM (0206H) Bit symbol Read/Write After reset Function CDE R/W 0 Cursor 0: OFF 1: ON
6
CCS R/W 0 Cursor color 0: White 1: Black
5
4
3
2
1
CBE1 R/W 0
Cursor blink interval (XT1: 32 kHz)
0
CBE0 R/W 0
00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz
Note 1:
Cursor brink interval make using low clock (fs). This function doesn't depend on LCDMODE. Therefore if you use blink function, you set low clock condition.
Note 2:
Also case of using timer out "TA3OUT" to LCDCK, cursor brink internal depend on fs.
LCD Cursor Width Setting Register 7
LCDCW (0207H) Bit symbol Read/Write After reset Function
6
5
4
CW4 R/W 0
3
CW3 R/W 0
2
CW2 R/W 0 Cursor width (X size) 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CW1 R/W 0
0
CW0 R/W 0
LCD Cursor Height Setting Register 7
LCDCH (0208H) Bit symbol Read/Write After reset Function
6
5
4
CH4 R/W 0
3
CH3 R/W 0
2
CH2 R/W 0 Cursor height (Y size) 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CH1 R/W 0
0
CH0 R/W 0
Figure 3.14.4 LCDC Control Register 3
92C820-246
2007-02-16
TMP92C820
Hot Point of LCD Cursor X Bit Setting Register 7
LCDCP (0209H) Bit symbol Read/Write After reset Function 0 0
6
5
4
3
APB3
2
APB2 R/W
1
APB1 0
0
APB0 0
Setting bit3 to bit0 for cursor hot point (for 1-dot correction)
In case of monochrome (Except BURST mode)
0000: Position pixel 0 1111: Position pixel 15
Figure 3.14.5 LCDC Control Register 4 LCD Cursor Absolute Position Setting Register 7
LCDCPL (020AH) Bit symbol Read/Write After reset Function CAP7 R/W 0
6
CAP6 R/W 0
5
CAP5 R/W 0
4
CAP4 R/W 0
3
CAP3 R/W 0
2
CAP2 R/W 0
1
CAP1 R/W 0
0
CAP0 R/W 0
Setting bit7 to bit0 for cursor absolute position
LCD Cursor Absolute Position Setting Register 7
LCDCPM (020BH) Bit symbol Read/Write After reset Function CAP15 R/W 0
6
CAP14 R/W 0
5
CAP13 R/W 0
4
CAP12 R/W 0
3
CAP11 R/W 0
2
CAP10 R/W 0
1
CAP9 R/W 0
0
CAP8 R/W 0
Setting bit15 to bit8 for cursor absolute position
LCD Cursor Absolute Position Setting Register 7
LCDCPH (020CH) Bit symbol Read/Write After reset Function CAP23 R/W 0
6
CAP22 R/W 1
5
CAP21 R/W 0
4
CAP20 R/W 0
3
CAP19 R/W 0
2
CAP18 R/W 0
1
CAP17 R/W 0
0
CAP16 R/W 0
Setting bit23 to bit16 for cursor absolute position
Figure 3.14.6 LCDC Control Register 5
92C820-247
2007-02-16
TMP92C820
LCDC1L, LCDC1H, LCDC2L, LCDC2H, LCDC3L, LCDC3H, LCDR1L and LCDR1H Register 7
Bit symbol Read/Write After reset Function D7
6
D6
5
D5
4
D4
3
D3
2
D2
1
D1
0
D0
Depend on the specification of external LCD driver Depend on the specification of external LCD driver Depend on the specification of external LCD driver
Figure 3.14.7 LCDC Control Register 6 These registers do not exist on TMP92C820. These are image for instruction registers and display registers of external RAM built-in sequential access type LCD driver. Address as Figure 3.14.4 is assigned to these registers, and the following chip enable pin becomes active when accesses corresponding address. And, the area of these address is external area, so RD , WR terminal becomes active by external access.
1H
Figure 3.14.5 shows the address map in the case of controlling RAM built-in random access type LCD driver. The explanation part of MMU circuit also explains this. This setup is performed by LCDCTL.
2H
Table 3.14.4 Memory Mapping for Built-in RAM Sequential Access Type Register
LCDC1L LCDC1H LCDC2L LCDC2H LCDC3L LCDC3H LCDR1L LCDR1H
Address
1FE0H 1FE1H 1FE2H 1FE3H 1FE4H 1FE5H 1FE6H 1FE7H
Purpose Sequential Access Type
RAM built-in type column driver 1 RAM built-in type column driver 2 RAM built-in type column driver 3 RAM built-in type row driver Instruction Display data Instruction Display data Instruction Display data Instruction Display data
Chip A0 Enable Terminal Terminal
D1BSCP D2BLP D3BFR DLEBCD 0 1 0 1 0 1 0 1
92C820-248
2007-02-16
TMP92C820
Table 3.14.5 Memory Mapping for Built-in RAM Random Access Type Address
3C0000H to 3CFFFFH 3D0000H to 3DFFFFH 3E0000H to 3EFFFFH 3F0000H to 3FFFFFH
Purpose Random Access Type
Chip Enable Terminal
D1BSCP D2BLP D3BFR DLEBCD
RAM built-in type driver 1 RAM built-in type driver 2 RAM built-in type driver 3 RAM built-in type driver
Note 1: We call built-in RAM sequential access type LCD driver that use register to access to display RAM without address. (Example: T6B65A, T6C84 etc., mar/2000) Note 2: We call built-in RAM random access type LCD driver that is same method to access to SRAM. (Example: T6C23,T6K01 etc., mar/2000)
92C820-249
2007-02-16
TMP92C820 3.14.4 Shift Register Type LCD Driver Control Mode (SR mode)
Set the mode of operation, start address of source data save memory, grayscale level and LCD size to control registers before setting start register. After set start register LCDC outputs bus release request to CPU and read data from source memory. After that LCDC transmits data of volume of LCD size to external LCD driver through LD bus (LCD personal bus). At this time, control signals (DIBSCP etc.) connected LCD driver output specified waveform synchronizes with data transmission. After finish data transmission, LCDC cancels the bus release request and CPU will re-start. Note: SR mode LCDC, during data reading (during DMA operation), CPU is stopped by internal BUSREQ signal. When using SR mode LCDC, programmer need to care the CPU stop time. For detail, see the Table 3.14.4.
3H
3.14.4.1 Operation
92C820-250
2007-02-16
TMP92C820
3.14.4.2 Grayscale Mode Indication
Monochrome, 4, 8 and 16 grayscale mode can be selected by setting LCDGL. And when SDRAM mode, you can select the size of SDRAM by setting (LCDMODE). TMP92C820 realize grayscale display by thinning out the frame. Grayscale control palette is defined by 16 bit register (LGnL/H) shown in Table 3.14.6. Palette is selected according to the grayscale level (Monochrome, 4, 8, 16 gray) for use. (cf. Table 3.14.7). ON/OFF for data of each level (e.g., each density) can modify by 16-bit register (LGnL/H). However each register of palette has a initial value, it is possible to adjust finely which matches to LCD driver you use and the characteristic of LCD panel.
4H 5H
Table 3.14.6 Grayscale Control Palette Default Setting
t D3BFR
Level Code Density
F E D C B A 9 8 7 6 5 4 3 2 1 0 16/16 14/16 1316 12/16 11/16 10/16 9/16 8/16 7/16 6/16 5/16 4/16 3/16 2/16 1/16 0/16
Data Setting Register Bit 1 (Address/After reset) 0
LGFH/L (023FH to E/FFFFH) LGEH/L (023DH to C/FDFDH) LGDH/L (023BH to A/FDDDH) LGCH/L (0239H to 8/DDDDH) LGBH/L (0237H to 6/DDD5H) LGAH/L (0235H to 4/D5D5H) LG9H/L (0233H to 2/D555H) LG8H/L (0231H to 0/AAAAH) LG7H/L (022FH to E/8AAAH) LG6H/L (022DH to C/8A8AH) LG5H/L (022BH to A/888AH) LG4H/L (0229H to 8/8888H) LG3H/L (0227H to 6/8880H) LG2H/L (0225H to 4/8080H) LG1H/L (0223H to 2/8000H) LG0H/L (0221H to 0/0000H)
2 * * * * * * *
3 * * * * * * * * *
4 * * * * * * *
5 * * * *
6 * * * * * * *
7 * * * * * * * * * * * * *
8 * * * * * * *
9 10 11 12 13 14 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * *
* * * * *
*: Display ON, : Display OFF Table 3.14.7 Grayscale Control Palette Effective Registers for Each Gray Level
LG0 LG1 LG2 LG3 LG4 LG5 LG6 LG7 LG8 LG9 LGA LGB LGC LGD LGE LGE L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H 16 gray levels 8 gray levels 4 gray levels Monochrome
* * * *
*
x x x
* *
x x
*
x x x
* * *
x
*
x x x
* *
x x
*
x x x
* * *
x
*
x x x
* *
x x
*
x x x
* *
x x
*
x x x
*
x x x
* * * *
x: Don't care, *: Effective
92C820-251
2007-02-16
TMP92C820
3.14.4.3 Memory Mapping
The LCDC can display the LCD panel image which is divided horizontally into 3 parts; upper, middle and lower. Each area calls A, B and C area that has some characteristics showing below. Start/End address of each area in the physical memory space can be defined in the LCD Start/End address registers (See Table 3.14.3). (C area can be defined only start address.) A and B areas are programmable visibility and they are set enable or not in LCDMODE register. When A and B area are disable, the C area take over all panel space. When the size of A or B area is greater than LCD panel, the area of the panel is all C area because the displaying priority is A > B > C. If the A area set to enable while the panel area is defined as all C area (that is A and B area are disable), C area is shifted to under the LCD panel and A area is inserted from the top of the LCD panel. Similarly if the B area set to enable while the panel area is defined as all C area, B area is inserted from the bottom of the C area overlapping.
6H
Memory map image
Logic address 400000H
Ya
Column address A area
Reserved area for horizontal pan of C area * Display data cannot input closely when you don't use the pan function.
LCD panel image
X
Vertical pan B area
Yb
A area C area
Ya
Row address C area
Yc
Yc
B area
Yb
Horizontal pan 2X 600000H
Figure 3.14.8 Memory Mapping from Physical Memory to LCD Panel
92C820-252
2007-02-16
TMP92C820
* Display memory mapping and panning function
LCDC can change the panel window if only you change each start address of A, B and C area. A and B area can be vertical panned by changing row address. While C area can be vertical and horizontal panned by changing row and column address. An important thing is that display data from one line to the next line, cannot be input continuously even if you don't use the panning function. One row address of display RAM corresponds to 1st line of display panel. Now display data of 2nd line cannot be set within the 1st row address of display RAM even if the necessary data for the size you want to display do not fill the capacity of 1st row address of display RAM. Adding the one line to display panel is equal to adding one address to row address of display RAM. And another important thing is, this limitation is also for SRAM as display RAM without address multiplex. When you use SDRAM as display RAM, you can select the size for display RAM capacity of one line (Number of column address: select 512 byte = 64 Mbytes 1024 byte = 128 Mbytes) bit. But in case of using SRAM, display RAM capacity of one line is fixed to 512 bytes. 16-bit bus width Start address Display panel of 1st line memory area Memory area for display 1st line (When using SRAM, this area is fixed to 512 bytes.)
Reserved area for vertical panning (Display 1st line)
Display panel of 2nd line memory area Memory area for display 2nd line (When using SRAM, this area is fixed to 512 bytes.)
Reserved area for vertical panning (Display 2nd line)
Display panel of 3rd line memory area Memory area for display 3rd line (When using SRAM, this area is fixed to 512 bytes.)
Reserved area for vertical panning (Display 3rd line)
Figure 3.14.9 Memory Mapping Image for SRAM as Display RAM
92C820-253
2007-02-16
TMP92C820
TMP92C820 can select four display scale; monochrome, 4 gray, 8 gray and 16 gray levels. With the intrinsic property of gray levels, a pixel is decoded in each gray level from different memory size. A pixel is equal to a bit in memory for monochrome, while a pixel is equal to 2 bits in memory for 4 gray levels, 3 bits for 8 gray levels and 4 bits for 16 gray levels. Therefore when the 4 gray mode, column address in the memory needs twice data capacity as large as dots that is displayed in the LCD panel actually showing Figure 3.14.88. Place for display data setting has some differences for each grayscale or sort of memory.
7H H
Monochrome (SRAM mode) Monochrome (SDRAM mode)
D7 D8 D15 D0 px0 px1 px2 px3 px4 px5 px6 px7 px8 px9 px10 px11 px12 px13 px14 px15
px0 px1 px2 px3 px4 px5 px6 px7
4 gray levels
px0
px1
px2
px3
px4
px5
px6
px7
8 gray levels
px0
px1
px2
px3
16 gray levels
px0
px1
px2
px3 : Don't care
Figure 3.14.10 Memory Codes for Each Gray Level in a Read Cycle (16 bits) And "px" in above Figure 3.14.10 corresponds to the image of LCD panel as below (1Figure 3.14.11). But TMP92C820 outputs data of px0 from PE7 (LD7), and data of px7 from PE0 (LD0). Therefore PE0 (LD0) should be connected to the MSB of LCD driver (e.g., DI7) according to LCD driver you use. Please note that the way TMP92C820 outputs the data differs from LCD controller built-in TLCS-900/L1 series of TOSHIBA (e.g., TMP91C815, TMP91C016, and TMP91C025 etc.).
9H 0H
LCD panel Segment driver LD7 LD6 LD5 LD4 LD3 LD2 LD1 LD0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
px0 px1 px2 px3 px4 px5 px6 px7 px8 px9 px10 px11 px12 px13 px14 px15
Figure 3.14.11 Connection between LD Bus of TMP92C820 and Data Bus of LCDD
92C820-254
2007-02-16
TMP92C820
3.14.4.4 Hardware Cursor
TMP92C820 has a cursor that is blinking interval, color and size can be specified, and maximum size is 32 x 32. A programmer can control the cursor attributes easily by filling those cursor registers, for example color (White/black), blinking interval time, size and precise pixel location. Its space location is specified by left-up hot point. (See Figure 3.14.12) The precise location of the hot point is determined by memory address (LCDCPH, LCDCPM, LCDCPL) and bit correction number (LCDCP). For example, however 1 pixel for displaying needs 2 bits of setting data under 4 gray mode, you can correct the location of hot point every 1 bit by setting pixel number which you want to move in the register (LCDCP).
1H
Cursor image is showed under the setting A, B, C area are enable, 4 gray mode, start address = 410004H and correction bit (LCDCP) = 3H in the following figure. Memory map image
Logic address 400000H A area
Row address
LCD panel image
A area C area
Cursor width
B area
Cursor height
C area 410000H Column address
Correction bit: 3H
Hot point
B area Cursor start address 410004H
600000H
SDRAM size = 1 = 0
A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 "0"
Row address Cursor start address
Column address Ignore
Figure 3.14.12 Cursor Hot Point Position and Size
Note: If panning function is set to enable during hardware cursor displaying, the cursor moves with the data in the memory. Because TMP92C820 sets the hardware cursor in the memory address.
92C820-255
2007-02-16
TMP92C820
LCD Cursor Setting Register 7
LCDCM (0206H) Bit symbol Read/Write After reset Function CDE R/W 0 Cursor 0: OFF 1: ON
6
CCS R/W 0 Cursor color 0: White 1: Black
5
4
3
2
1
CBE1 R/W 0 00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz
0
CBE0 R/W 0
Cursor blink interval
Note 1: Note 2:
The function of cursor blink is effective only when low-frequency oscillator is input 32 kHz. The function of cursor blink depends on the low-frequency oscillator even if you use timer out "TA3OUT" as LCDCK.
LCD Cursor Width Setting Register 7
LCDCW (0207H) Bit symbol Read/Write After reset Function
6
5
4
CW4 R/W 0
3
CW3 R/W 0
2
CW2 R/W 0 Cursor width (X size) 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CW1 R/W 0
0
CW0 R/W 0
LCD Cursor Height Setting Register 7
LCDCH (0208H) Bit symbol Read/Write After reset Function
6
5
4
CH4 R/W 0
3
CH3 R/W 0
2
CH2 R/W 0 Cursor height (Y size) 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CH1 R/W 0
0
CH0 R/W 0
LCD Cursor Start Address Setting Register 7
LCDCPL (020AH) Bit symbol Read/Write After reset Function CAP7 R/W 0
6
CAP6 R/W 0
5
CAP5 R/W 0
4
CAP4 R/W 0
3
CAP3 R/W 0
2
CAP2 R/W 0
1
CAP1 R/W 0
0
CAP0 R/W 0
Setting bit7 to bit0 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPM (020BH) Bit symbol Read/Write After reset Function CAP15 R/W 0
6
CAP14 R/W 0
5
CAP13 R/W 0
4
CAP12 R/W 0
3
CAP11 R/W 0
2
CAP10 R/W 0
1
CAP9 R/W 0
0
CAP8 R/W 0
Setting bit15 to bit8 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPH (020CH) Bit symbol Read/Write After reset Function CAP23 R/W 0
6
CAP22 R/W 1
5
CAP21 R/W 0
4
CAP20 R/W 0
3
CAP19 R/W 0
2
CAP18 R/W 0
1
CAP17 R/W 0
0
CAP16 R/W 0
Setting bit23 to bit16 for cursor start address
92C820-256
2007-02-16
TMP92C820
LCD Cursor Hot Point Pixel Number (Bit correction) Setting Register 7
LCDCP (0209H) Bit symbol Read/Write After reset Function 0 0
6
5
4
3
APB3
2
APB2 R/W
1
APB1 0
0
APB0 0
Setting bit3 to bit0 of pixel for correction of hot point (for 1-dot correction)
In case of monochrome (SRAM mode)
0000: 0 pixels correct 1111: 0 pixels correct
In case of monochrome (SDRAM mode) and 4 gray levels
x000: 0 pixels correct x001: 1 pixel correct x010: 2 pixels correct x011: 3 pixels correct
x100: 4 pixels correct x101: 5 pixels correct x110: 6 pixels correct x111: 7 pixels correct xx10: 2 pixels correct xx11: 3 pixels correct
In case of 8 and 16 gray levels X: Don't care
xx00: 0 pixels correct xx01: 1 pixel correct
Here, it is possible to correct the cursor per 1 bit from the start address set before. Pixel number should be adjusted in response to the gray mode setting showing above. For example, when 4 gray levels and 16-bit bus mode, correction should be less than 7 because the smallest pixel is 8 pixels that can set by start address setting. Similarly correction pixel should be less than 15 at monochrome mode, 3 at 8 or 16 gray modes. Example: When monochrome mode, correction value is (LCDCP) = 011H, and cursor size = (8 x 8)
3 bits move Start address (LCDCPH/M/L) CURSOR Hot point
LCD panel
Figure 3.14.13 The Location Hot Point by Setting of Pixel
92C820-257
2007-02-16
TMP92C820
3.14.4.5 Frame Signal Settlement
TMP92C820 defines so-called frame period (refresh interval for LCD panel) by the value set in fFP [9:0]. DLEBCD pin outputs pulse every frame period. D3BFR pin usually outputs the signal inverts polarity every frame period. And TMP92C820 has a special function that can set the timing of inverting frame polarity irrelevant to above frame frequency for the purpose of preventing the patches of display. LCD Control Register 7
LCDCTL (0203H) Bit symbol Read/Write After reset Function LCDON R/W 0
DOFF port
6
ALL0 R/W 0 Setting all column ports to 0 0: Normal 1: All display data = 0
5
FRMON R/W 0 Divided FR mode 0: Disable 1: Enable
4
- R/W 0 Always write "0".
3
FP9 R/W 0
2
MMULCD R/W 0
1
FP8 R/W 0
0
START R/W 0
0: OFF 1: ON
Setting bit9 Type setting Setting bit8 Start control for fFP [9:0] in SR mode for fFP [9:0] of LCD 0: Stop driver with 1: Start built-in RAM 0: Sequen -tial access type 1: Random access type
LCD fFP Register 7
LCDFFP (0204H) Bit symbol Read/Write After reset Function 0 0 0 0 FP7
6
FP6
5
FP5
4
FP4 R/W
3
FP3 0
2
FP2 0
1
FP1 0
0
FP0 0
Setting bit7 to 0 for fFP
Divide FRM Register 7
LCDDVM (0201H) Bit symbol Read/Write After reset Function 0 0 0 0 FMN7
6
FMN6
5
FMN5
4
FMN4 R/W
3
FMN3 0
2
FMN2 0
1
FMN1 0
0
FMN0 0
Setting DVM bit7 to 0
92C820-258
2007-02-16
TMP92C820
(1) Settlement of frame frequency function Basic frame period; DLEBCD signal, is made according to the resister fFP [9:0] setting mentioned before. However this fFP [9:0] setting is generally equal to common number, frame period can be corrected by increasing fFP [9:0] with ease. This function cannot correct frame frequency higher than that of Table 3.14.8. If it is necessary to set frame frequency higher or detailed, please refer to (3) Timer out LCDCK.
12H
The equation can calculate frame period. Frame period = LCDCK/(D x fFP) [Hz] D: Constant for each common (1Table 3.14.8)
3H
fFP: Setting of fFP [9:0] register LCDCK: Source clock of LCD (Low clock is usually selected) Please select the value of fFP [9:0] as the frame period you want to set in the Table 3.14.8
14H
Note: Please make the value set to fFP [9:0] into the following range. COM (Common number) fFP 1024 Example 1: In the case where frame period is set to 72.10 Hz by 240 coms. fFP = 240 (COM) + 63 = 303 = 12FH (by Table 3.14.8)
15H
Therefore, LCDCTL = 1_hex and LCDFFP = 2FH are setup. (2) Frame invert adjustment function This mode can prevent the deterioration of display (e.g., patches of display). *Note 1: If N is set in (LCDDVM) register while this function is set to enable in register (LCDCTL)( "1"), D3BFR pin outputs the signal inverted polarity every (D2BLP x N) timing. If this function isn't necessary, D3BFR pin outputs the signal inverted polarity every frequency of DLEBCD pin after setting this function disable ((LCDCTL) = "0"). And it is no change wave and timing for DLEBCD pin by LCDDVM setting.
Note: Effects of this function have some differences as the LCD driver or LCD panel you use actually.
92C820-259
2007-02-16
TMP92C820
(3) Timer out LCDCK LCD source clock (LCDCK) can select low frequency (XT1, XT2: 32.768 [kHz]) or timer out (TA3OUT) outputs from internal TMRA23. Example 2: Here indicates the method that frame period is set 70 [Hz] by selecting TA3OUT for source clock of LCD. (fc = 6 [MHz], 128 COM) The next equation calculates frame period. Frame period = 1/(tLP x fFP) [Hz] tLP = D/XT XT = 128 x 3 x 70 = 26880 [Hz] XT should be above value. In order to make XT = 26880 [Hz] under fc = 6 [MHz] with T1 of timer3, 1/XT = T3 x 2 x 8 x 2/ fc [s] in short, XT = fc/(T3 x 2 x 8 x 2) [Hz] However T3 = (TA3REG) is 6.98 after calculate, it's impossible to set the value under a decimal point. So if (TA3REG) is set 06H, XT = 31250 [Hz]. And because of D = 3, Frame period = 31250/(128 x 3) = 81.38 [Hz] Further if fFP is 148 (COM + 20) with correction, Frame period = 31250/(148 x 3) = 70.38 [Hz] Reference: To maintain quality for display, please refer to following value for each grayscale. (You have to use settlement of frame frequency function, frame invert adjustment function and timer out LCDCK.) Monochrome: Frame period = 70 [Hz] 4/8/16 gray levels: Frame period = 140 [Hz] T3: the value of timer register (TA3REG) tLP: The period of D2BLP D: The value is 3 at 128 COM Source clock for LCDC defines as XT [Hz] and then this tLP represents Therefore if you set the frame period at 70 [Hz] under 128 COM,
92C820-260
2007-02-16
TMP92C820
fFP = 78.02 Hz (at = 120) D3BFR Display time for 1 picture (120 com)
DLEBCD
1 2 3 120 1 2 3 120 1 2
D2BLP
D1BSCP
D7 to D0
Data transmission (240 seg = 30 bytes) of volume of 1com
Figure 3.14.14 Timing Diagram for SR Mode
D3BFR
tLP: LP period
DLEBCD tSTOP: Stop time D2BLP tLPH = 0.5XT tOPR: CPU operating time
BUSRQ (Internal) D1BSCP
tSCP = 2 states
D7 to D0
N
N+1
N + 28
N + 29
XT = 1/32768 [s] 1 state = 1/fSYS [s]
Figure 3.14.15 Timing Diagram for SR Mode (Detail) D3BFR waveform (in case of 240 rows + 63 (fFP) and LCDDVM = 0BH)
LP1 D2BLP waveform LP2 LP3 LP10 LP11 LP301 LP302 LP303 LP304
D3BFR waveform
Divided frame disable
Divided frame enable
Figure 3.14.16 D2BLP and D3BFR Waveform
92C820-261
2007-02-16
TMP92C820
Table 3.14.8 fFP Table for Each Common Number (1/2) D
COM COM + 0 COM + 1 COM + 2 COM + 3 COM + 4 COM + 5 COM + 6 COM + 7 COM + 8 COM + 9 COM + 10 COM + 11 COM + 12 COM + 13 COM + 14 COM + 15 COM + 16 COM + 17 COM + 18 COM + 19 COM + 20 COM + 21 COM + 22 COM + 23 COM + 24 COM + 25 COM + 26 COM + 27 COM + 28 COM + 29 COM + 30 COM + 31 COM + 32 COM + 33 COM + 34 COM + 35 COM + 36 COM + 37 COM + 38 COM + 39 COM + 40 COM + 41 COM + 42 COM + 43 COM + 44 COM + 45 COM + 46 COM + 47 COM + 48 COM + 49 COM + 50 COM + 51
3
128 85.33 84.67 84.02 83.38 82.75 82.13 81.51 80.91 80.31 79.73 79.15 78.58 78.02 77.47 76.92 76.38 75.85 75.33 74.81 74.30 73.80 73.31 72.82 72.34 71.86 71.39 70.93 70.47 70.02 69.57 69.13 68.70 68.27 67.84 67.42 67.01 66.60 66.20 65.80 65.41 65.02 64.63 64.25 63.88 63.50 63.14 62.77 62.42 62.06 61.71 61.36 61.02
2.5
160 81.92 81.41 80.91 80.41 79.92 79.44 78.96 78.49 78.02 77.56 77.10 76.65 76.20 75.76 75.33 74.90 74.47 74.05 73.64 73.22 72.82 72.42 72.02 71.62 71.23 70.85 70.47 70.09 69.72 69.35 68.99 68.62 68.27 67.91 67.56 67.22 66.87 66.53 66.20 65.87 65.54 65.21 64.89 64.57 64.25 63.94 63.63 63.32 63.02 62.71 62.42 62.12
2
200 81.92 81.51 81.11 80.71 80.31 79.92 79.53 79.15 78.77 78.39 78.02 77.65 77.28 76.92 76.56 76.20 75.85 75.50 75.16 74.81 74.47 74.14 73.80 73.47 73.14 72.82 72.50 72.18 71.86 71.55 71.23 70.93 70.62 70.32 70.02 69.72 69.42 69.13 68.84 68.55 68.27 67.98 67.70 67.42 67.15 66.87 66.60 66.33 66.06 65.80 65.54 65.27
1.5
240 91.02 90.64 90.27 89.90 89.53 89.16 88.80 88.44 88.09 87.73 87.38 87.03 86.69 86.35 86.01 85.67 85.33 85.00 84.67 84.34 84.02 83.70 83.38 83.06 82.75 82.44 82.13 81.82 81.51 81.21 80.91 80.61 80.31 80.02 79.73 79.44 79.15 78.86 78.58 78.30 78.02 77.74 77.47 77.19 76.92 76.65 76.38 76.12 75.85 75.59 75.33 75.07
1.5
320 68.27 68.05 67.84 67.63 67.42 67.22 67.01 66.81 66.60 66.40 66.20 66.00 65.80 65.60 65.41 65.21 65.02 64.82 64.63 64.44 64.25 64.06 63.88 63.69 63.50 63.32 63.14 62.95 62.77 62.59 62.42 62.24 62.06 61.88 61.71 61.54 61.36 61.19 61.02 60.85 60.68 60.51 60.35 60.18 60.01 59.85 59.69 59.52 59.36 59.20 59.04 58.88
1
400 81.92 81.72 81.51 81.31 81.11 80.91 80.71 80.51 80.31 80.12 79.92 79.73 79.53 79.34 79.15 78.96 78.77 78.58 78.39 78.21 78.02 77.83 77.65 77.47 77.28 77.10 76.92 76.74 76.56 76.38 76.20 76.03 75.85 75.68 75.50 75.33 75.16 74.98 74.81 74.64 74.47 74.30 74.14 73.97 73.80 73.64 73.47 73.31 73.14 72.98 72.82 72.66
1
480 68.27 68.12 67.98 67.84 67.70 67.56 67.42 67.29 67.15 67.01 66.87 66.74 66.60 66.47 66.33 66.20 66.06 65.93 65.80 65.67 65.54 65.41 65.27 65.15 65.02 64.89 64.76 64.63 64.50 64.38 64.25 64.13 64.00 63.88 63.75 63.63 63.50 63.38 63.26 63.14 63.02 62.89 62.77 62.65 62.53 62.42 62.30 62.18 62.06 61.94 61.83 61.71
92C820-262
2007-02-16
TMP92C820
Table 3.14.8 fFP Table for Each Common Number (2/2) D
COM COM + 52 COM + 53 COM + 54 COM + 55 COM + 56 COM + 57 COM + 58 COM + 59 COM + 60 COM + 61 COM + 62 COM + 63 COM + 64 COM + 65 COM + 66 COM + 67 COM + 68 COM + 69 COM + 70 COM + 71 COM + 72 COM + 73 COM + 74 COM + 75 COM + 76 COM + 77 COM + 78 COM + 79 COM + 80
3
128 60.68 60.35 60.01 59.69 59.36 59.04 58.72 58.41 58.10 57.79 57.49 57.19 56.89 56.59 56.30 56.01 55.73 55.45 55.16 54.89 54.61 54.34 54.07 53.81 53.54 53.28 53.02 52.77 52.51
2.5
160 61.83 61.54 61.25 60.96 60.68 60.40 60.12 59.85 59.58 59.31 59.04 58.78 58.51 58.25 58.00 57.74 57.49 57.24 56.99 56.74 56.50 56.25 56.01 55.78 55.54 55.30 55.07 54.84 54.61
2
200 65.02 64.76 64.50 64.25 64.00 63.75 63.50 63.26 63.02 62.77 62.53 62.30 62.06 61.83 61.59 61.36 61.13 60.91 60.68 60.46 60.24 60.01 59.80 59.58 59.36 59.15 58.94 58.72 58.51
1.5
240 74.81 74.56 74.30 74.05 73.80 73.55 73.31 73.06 72.82 72.58 72.34 72.10 71.86 71.62 71.39 71.16 70.93 70.70 70.47 70.24 70.02 69.79 69.57 69.35 69.13 68.91 68.70 68.48 68.27
1.5
320 58.72 58.57 58.41 58.25 58.10 57.95 57.79 57.64 57.49 57.34 57.19 57.04 56.89 56.74 56.59 56.45 56.30 56.16 56.01 55.87 55.73 55.59 55.45 55.30 55.16 55.03 54.89 54.75 54.61
1
400 72.50 72.34 72.18 72.02 71.86 71.70 71.55 71.39 71.23 71.08 70.93 70.77 70.62 70.47 70.32 70.17 70.02 69.87 69.72 69.57 69.42 69.28 69.13 68.99 68.84 68.70 68.55 68.41 68.27
1
480 61.59 61.48 61.36 61.25 61.13 61.02 60.91 60.79 60.68 60.57 60.46 60.35 60.24 60.12 60.01 59.90 59.80 59.69 59.58 59.47 59.36 59.25 59.15 59.04 58.94 58.83 58.72 58.62 58.51
Note:
The above time distance are value which used fs = 32.768 [kHz].
92C820-263
2007-02-16
TMP92C820
Table 3.14.9 Performance Listing for Each Segment and Common Number (1) SDRAM (Burst) 16 bits, 8/16 gray levels
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 1.2 1.3 1.4 1.5 1.9 2.1 2.4 2.6 2.9 3.2 3.4 3.7 3.9 4.3 4.4 4.8 160 2.5 76.3 1.2 1.6 1.4 1.8 1.9 2.5 2.4 3.1 2.9 3.8 3.4 4.5 3.9 5.1 4.4 5.8 200 2 61 1.2 2.0 1.4 2.3 1.9 3.1 2.4 3.9 2.9 4.8 3.4 5.6 3.9 6.4 4.4 7.2 240 1.5 45.8 1.2 2.6 1.4 3.1 1.9 4.1 2.4 5.2 2.9 6.3 3.4 7.4 3.9 8.5 4.4 9.6 320 1.5 45.8 1.2 2.6 1.4 3.1 1.9 4.1 2.4 5.2 2.9 6.3 3.4 7.4 3.9 8.5 4.4 9.6 400 1 30.5 1.2 3.9 1.4 4.6 1.9 6.2 2.4 7.9 2.9 9.5 3.4 11.1 3.9 12.8 4.4 14.4 480 1 30.5 1.2 3.9 1.4 4.6 1.9 6.2 2.4 7.9 2.9 9.5 3.4 11.1 3.9 12.8 4.4 14.4
(2) SDRAM (Burst) 16 bits, 4 gray levels
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 1.2 1.3 1.4 1.5 1.9 2.1 2.4 2.6 2.9 3.2 3.4 3.7 3.9 4.3 4.4 4.8 160 2.5 76.3 1.2 1.6 1.4 1.8 1.9 2.5 2.4 3.1 2.9 3.8 3.4 4.5 3.9 5.1 4.4 5.8 200 2 61 1.2 2.0 1.4 2.3 1.9 3.1 2.4 3.9 2.9 4.8 3.4 5.6 3.9 6.4 4.4 7.2 240 1.5 45.8 1.2 2.6 1.4 3.1 1.9 4.1 2.4 5.2 2.9 6.3 3.4 7.4 3.9 8.5 4.4 9.6 320 1.5 45.8 1.2 2.6 1.4 3.1 1.9 4.1 2.4 5.2 2.9 6.3 3.4 7.4 3.9 8.5 4.4 9.6 400 1 30.5 1.2 3.9 1.4 4.6 1.9 6.2 2.4 7.9 2.9 9.5 3.4 11.1 3.9 12.8 4.4 14.4 480 1 30.5 1.2 3.9 1.4 4.6 1.9 6.2 2.4 7.9 2.9 9.5 3.4 11.1 3.9 12.8 4.4 14.4
92C820-264
2007-02-16
TMP92C820
(3) SDRAM (Burst) 16 bits, monochrome
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 0.8 0.9 0.9 1.0 1.2 1.3 1.4 1.5 1.7 1.8 1.9 2.1 2.2 2.3 2.4 2.6 160 2.5 76.3 0.8 1.0 0.9 1.2 1.2 1.5 1.4 1.8 1.7 2.2 1.9 2.5 2.2 2.8 2.4 3.1 200 2 61 0.8 1.3 0.9 1.5 1.2 1.9 1.4 2.3 1.7 2.7 1.9 3.1 2.2 3.5 2.4 3.9 240 1.5 45.8 0.8 1.7 0.9 2.0 1.2 2.5 1.4 3.1 1.7 3.6 1.9 4.1 2.2 4.7 2.4 5.2 320 1.5 45.8 0.8 1.7 0.9 2.0 1.2 2.5 1.4 3.1 1.7 3.6 1.9 4.1 2.2 4.7 2.4 5.2 400 1 30.5 0.8 2.6 0.9 3.0 1.2 3.8 1.4 4.6 1.7 5.4 1.9 6.2 2.2 7.0 2.4 7.9 480 1 30.5 0.8 2.6 0.9 3.0 1.2 3.8 1.4 4.6 1.7 5.4 1.9 6.2 2.2 7.0 2.4 7.9
(4) SRAM (2 states) 16 bits, 8/16 gray levels (Note 2)
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 3.4 3.7 4.2 4.5 6.2 6.7 8.2 8.9 10.2 11.1 12.2 13.3 14.2 15.4 16.2 17.6 160 2.5 76.3 3.4 4.4 4.2 5.4 6.2 8.1 8.2 10.7 10.2 13.3 12.2 15.9 14.2 18.5 16.2 21.2 200 2 61 3.4 5.5 4.2 6.8 6.2 10.1 8.2 13.4 10.2 16.6 12.2 19.9 14.2 23.2 16.2 26.5 240 1.5 45.8 3.4 7.3 4.2 9.1 6.2 13.4 8.2 17.8 10.2 22.2 12.2 26.5 14.2 30.9 16.2 35.3 320 1.5 45.8 3.4 7.3 4.2 9.1 6.2 13.4 8.2 17.8 10.2 22.2 12.2 26.5 14.2 30.9 16.2 35.3 400 1 30.5 3.4 11.0 4.2 13.6 6.2 20.2 8.2 26.7 10.2 33.3 12.2 39.8 14.2 46.4 16.2 53.0 480 1 30.5 3.4 11.0 4.2 13.6 6.2 20.2 8.2 26.7 10.2 33.3 12.2 39.8 14.2 46.4 16.2 53.0
92C820-265
2007-02-16
TMP92C820
(5) SRAM (2 states) 16 bits, 4 gray levels (Note 2)
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 1.8 1.9 2.2 2.3 3.2 3.4 4.2 4.5 5.2 5.6 6.2 6.7 7.2 7.8 8.2 8.9 160 2.5 76.3 1.8 2.3 2.2 2.8 3.2 4.1 4.2 5.4 5.2 6.7 6.2 8.1 7.2 9.4 8.2 10.7 200 2 61 1.8 2.9 2.2 3.5 3.2 5.2 4.2 6.8 5.2 8.4 6.2 10.1 7.2 11.7 8.2 13.4 240 1.5 45.8 1.8 3.8 2.2 4.7 3.2 6.9 4.2 9.1 5.2 11.2 6.2 13.4 7.2 15.6 8.2 17.8 320 1.5 45.8 1.8 3.8 2.2 4.7 3.2 6.9 4.2 9.1 5.2 11.2 6.2 13.4 7.2 15.6 8.2 17.8 400 1 30.5 1.8 5.7 2.2 7.0 3.2 10.3 4.2 13.6 5.2 16.9 6.2 20.2 7.2 23.4 8.2 26.7 480 1 30.5 1.8 5.7 2.2 7.0 3.2 10.3 4.2 13.6 5.2 16.9 6.2 20.2 7.2 23.4 8.2 26.7
(6) SRAM (2 states) 16 bits, monochrome (Note 2)
Common Segment D tLP [s] 128 tSTOP [s] RATE [%] 160 tSTOP [s] RATE [%] 240 tSTOP [s] RATE [%] 320 tSTOP [s] RATE [%] 400 tSTOP [s] RATE [%] 480 tSTOP [s] RATE [%] 560 tSTOP [s] RATE [%] 640 tSTOP [s] RATE [%] 128 3 91.6 1.0 1.0 1.2 1.3 1.7 1.8 2.2 2.3 2.7 2.9 3.2 3.4 3.7 4.0 4.2 4.5 160 2.5 76.3 1.0 1.2 1.2 1.5 1.7 2.2 2.2 2.8 2.7 3.5 3.2 4.1 3.7 4.8 4.2 5.4 200 2 61 1.0 1.6 1.2 1.9 1.7 2.7 2.2 3.5 2.7 4.3 3.2 5.2 3.7 6.0 4.2 6.8 240 1.5 45.8 1.0 2.1 1.2 2.5 1.7 3.6 2.2 4.7 2.7 5.8 3.2 6.9 3.7 8.0 4.2 9.1 320 1.5 45.8 1.0 2.1 1.2 2.5 1.7 3.6 2.2 4.7 2.7 5.8 3.2 6.9 3.7 8.0 4.2 9.1 400 1 30.5 1.0 3.1 1.2 3.8 1.7 5.4 2.2 7.0 2.7 8.7 3.2 10.3 3.7 12.0 4.2 13.6 480 1 30.5 1.0 3.1 1.2 3.8 1.7 5.4 2.2 7.0 2.7 8.7 3.2 10.3 3.7 12.0 4.2 13.6
Note 1: These tables are calculated at following condition. 1) fSYS = 20 [MHz] 2) fs = 32.768 [kHz] 3) Overhead state number are 8 states for SDRAM and 3 states for SRAM. Note 2: For SRAM tables ((4) to (6)), tSTOP is calculated at 2-state accessing.
92C820-266
2007-02-16
TMP92C820
Table 3.14.10 Possible Panel Size of Panning
64-Mbit SDRAM/BURST Horizontal Monochrome 4 gray levels 8 gray levels 16 gray levels Vertical COM SEG 128 16.0 16.0 8.0 8.0 128 32.0 128-Mbit SDRAM/BURST Horizontal Monochrome 4 gray levels 8 gray levels 16 gray levels Vertical COM SEG 128 32.0 32.0 16.0 16.0 128 32.0 SRAM Horizontal Monochrome 4 gray levels 8 gray levels 16 gray levels Vertical COM SEG 128 32.0 16.0 8.0 8.0 128 32.0 160 25.6 12.8 6.4 6.4 160 25.6 240 17.1 8.5 4.3 4.3 200 20.5 320 12.8 6.4 3.2 3.2 240 17.1 400 10.2 5.1 2.6 2.6 320 12.8 480 8.5 4.3 2.1 2.1 400 10.2 560 7.3 3.7 1.8 1.8 480 8.5 Panels 640 6.4 3.2 1.6 1.6 Panels Panels Panels Panels 160 25.6 25.6 12.8 12.8 160 25.6 240 17.1 17.1 8.5 8.5 200 20.5 320 12.8 12.8 6.4 6.4 240 17.1 400 10.2 10.2 5.1 5.1 320 12.8 480 8.5 8.5 4.3 4.3 400 10.2 560 7.3 7.3 3.7 3.7 480 8.5 Panels 640 6.4 6.4 3.2 3.2 Panels Panels Panels Panels 160 12.8 12.8 6.4 6.4 160 25.6 240 8.5 8.5 4.3 4.3 200 20.5 320 6.2 6.4 3.2 3.2 240 17.1 400 5.1 5.1 2.6 2.6 320 12.8 480 4.3 4.3 2.1 2.1 400 10.2 560 3.7 3.7 1.8 1.8 480 8.5 Panels 640 3.2 3.2 1.6 1.6 Panels Panels Panels Panels
92C820-267
2007-02-16
TMP92C820
Note 1: The value of the Table 3.14.8 is at fFPH = 36 [MHz]. Note 2: CPU stop time; tSTOP (in the Figure 3.14.17) is the time which CPU reads the memory of transferring with 0 waits. Note 3: The following equation can calculate tLP listed below. (fs = 32.768 [kHz]) tLP = D/32768 [s] Example: If the row is 240 and D = 1.5 by the above table tLP = 1.5/32768 = 45.8 [s]
D3BFR pin
DLEBCD pin
1 2 3 120 1 2 3 120 1 2
D2BLP pin
D1BSCP pin
D7 to D0 pin
tLP
BUS occupation time of CPU tSTOP BUS occupation rate of CPU = tSTOP/tLP
Figure 3.14.17 Stop Time and BUS Occupation Rate of CPU
92C820-268
2007-02-16
TMP92C820
3.14.4.6 Timing Charts of Interpreting Memory Codes
TMP92C820 supports different memory accessing. They are SRAM with waits, SDRAM burst modes, and the size of SDRAM is 64 or 128 Mbits. The access signals for the LCD panel are shown in Figure 3.14.18. TMP92C820 include 80 bytes FIFO. Therefore, If CPU operate high speed, TMP92C820 can to use low-speed LCD driver. To catch low speed LCD drivers, 4 types of SCP rates (fSYS, fSYS/2, fSYS/4, and fSYS/8) can be selected. The output data (LD7:0) will be issued from the built-in FIFO at the rising edge of D1BSCP when the FIFO is no empty. The work of the FIFO is illustrated in Figure 3.14.19, where the buffer size 80 bytes. The FIFO latches BaseLD<7:0> signal at the falling edge of BaseSCP that is shown in Figure 3.14.20 and Figure 3.14.21 for SRAM and SDRAM modes respectively. The FIFO is always reset to the empty state by the rising edge of D2BLP. In base SCP mode (e.g., for SCPW1:0 = 00), D1BCP is equal to BaseSCP, LD<7:0> equal to BaseLD<7:0> and no FIFO used. Generally, the data input rate of FIFO should be greater than the output one.
16H 17H 18H 19H
To make FIFO work correctly, the following condition have to be satisfied by setting SFR properly. (SegNum/8 + 1) x tcw + 24 x tFPH < tLP - tLPH Here, SegNum is the segment number, and tCW D1BSCP clock cycle width. Referring Figure 3.14.22, we can know this relation means that the last LD<7:0> data must be generated before the rising edge of D2BLP. For example, in case of fFPH = 36 MHz, XT = 32 kHz, 4 gray levels, 240 commons, 640 segments, and SDRAM burst mode, the following table can be obtained, which tells user that 8 clock mode is impossible and base, 2, 4 clock modes can be used.
20H
Table 3.14.11 fFPH = 36 [MHz], XT = 32 [kHz], 4 Grayscale, 240 Common, 640 Segment, SDRAM Burst Mode SCPW
Base 2 CLK 4 CLK 8 CLK
D1BSCP Rate (MHz)
9 9 4.5 2.25
tcw (ns)
111.2 111.2 222.4 444.8
(SegNum/8 + 1) x tcw + 24 x tFPH (ns)
9674.4 9674.4 18681.6 36696
tLP - tLPH (ns)
31250 31250 31250 31250
Judgment
OK OK OK Error
Note: In case of SDRAM burst mode and 8/16 gray, the speed of base setting is equal to that of 2 CLK.
fSYS D1BSCP 2-clock SCP LD7 to LD0 D1BSCP 4-clock SCP LD7 to LD0 D1BSCP 8-clock SCP LD7 to LD0 OUT - 1 OUT OUT - 1 OUT OUT + 1
OUT - 1 OUT OUT + 1 OUT + 2 OUT + 3 OUT + 4
Figure 3.14.18 Timing Diagram for The LCD Driver Access Signals
92C820-269
2007-02-16
TMP92C820
BaseSCP
OUT
OUT + 1
OUT 80 bytes FIFO
OUT + 1
BaseLD7 to BaseLD0 fSYS fSYS/2, fSYS/4, fSYS/8 D2BLP
LD7 to LD0
D1BSCP
Note: D1BCP = BaseSCP and LD<7:0> = BaseLD<7:0> in BaseSCP mode (e.g., for SCPW<1:0> = 00)
Figure 3.14.19 Timing Diagram for FIFO
92C820-270
2007-02-16
TMP92C820
SRAM 0 WAIT Mode Internal system clock (fSYS) A23 to A0
RD
N
N+1
N+2
N+3
N+4
N+5
D15 to D0
IN
IN + 1
IN + 2
IN + 3
IN + 4
IN + 5
2 states BaseSCP
Data width: 16 bits
Monochrome
Data width: 32 bits
Monochrome, 4 gray levels
BaseLD7 to BaseLD0 BaseSCP BaseSCP BaseLD7 to BaseLD0 BaseSCP
OUT -1
OUT -1
OUT
OUT
OUT +1
OUT +1
OUT +2
OUT OUT +2 +3
OUT +3
OUT +4
OUT +4
4 gray levels
8/16 gray levels
OUT
OUT
OUT + 1 OUT + 2 OUT + 3 OUT + 4
8/16 gray levels
-
BaseLD7 to BaseLD0
OUT - 1
OUT
OUT + 1
Figure 3.14.20 Timing Diagram for SRAM Mode with BaseSCP
SDRAM Burst Mode
fSYS A23 to A0
RD
IN IN + 1 IN + 2 IN + 3 IN + 4 IN + 5 IN + 6 IN + 7
227 Row
Column
D15 to D0
Data width: 16 bits BaseSCP
Monochrome
Data width: 32 bits
Monochrome, 4 gray
BaseLD7 to BaseLD0 BaseSCP BaseSCP BaseLD7 to BaseLD0 BaseSCP
OUT
OUT +1
OUT OUT +2 +3
OUT +4
OUT +5
OUT +6
4 gray levels
OUT OUT +1 OUT OUT +2 +3 OUT +4 OUT +5 OUT +6
8/16 gray levels
8/16 gray levels
-
BaseLD7 to BaseLD0
OUT
OUT + 1 OUT + 2
Figure 3.14.21 Timing Diagram for SDRAM Burst Mode with BaseSCP
92C820-271
2007-02-16
TMP92C820
SDRAM BURST1 Clock Mode fSYS A23 to A0
RD
227 Row
Column
D15 to D0 BaseSCP
IN
IN + 1 IN + 2 IN + 3 IN + 4 IN + 5 IN + 6 IN + 7
Monochrome BaseLD7 to BaseLD0 D1BSCP OUT OUT
OUT + 1
OUT OUT OUT +1 OUT +1 OUT +2 OUT +2 OUT +3
tcw
LD7 to LD0 T_bufdly
D2BLP T_busdly (SegNum/8) x tcw + T_bufdly tLP Note 1: Note 2: 4tFPH T_bufdly tc + 2tFPH T_busdly is about 11 times as long as fSYS period (22 tFPH). tLPH
Figure 3.14.22 Timing Diagram for Maximum FIFO Delay Time
92C820-272
2007-02-16
TMP92C820
3.14.4.7 Examples to Use
TMP92C820 VDD T6C13B (240-row driver selection) VDD O001 VSS DIR TEST DI7 to DI0 DUAL SCP S/C VCCL/R, V0L/R, V1L/R, V4L/R, V5L/R O240
DSPOF
COM001
VSS
240 commons x 240 segments LCD SEG001 SEG240 VCCLR V0LR, V2LR, VSSLR, V3LR, V5LR VSS TEST DUAL O240
Power circuit
COM240
EIO2
EIO1
FR
Open DLEBCD D1BSCP D2BLP D3BFR
DOFF
LP
SCP LP FR
DSPOF
LD0 to LD7 Control signal D0 to D15 A0 to A23 Axx to Axx D0 to D15 Control signal VSS Open
VDD VSS Power circuit T6C13B (240-column driver selection)
Display memory (SDRAM/SRAM selection) Note 1: Note 2: Display memory support only 16-bit bus. Other circuit is necessary for LCD drive power supply for LCD driver display.
Figure 3.14.23 Interface Example for Shift Register Type LCD Driver Note: Because the connection between the line of display RAM data and output bus: LD<0:7> is just the mirror invertion, please care of connection. The data LSB of display RAM is output from LD7. In the above figure, LD0 should be connected to DI7 of LCDD driver, and LD1 to DI6. For detail information, please refer to Figure 3.14.11.
21H
DIR VDD S/C
DI7 to DI0 EIO1 EIO2
O001
92C820-273
2007-02-16
TMP92C820
20 dots
Cursor blink (Black 2 Hz)
20 dots 60 dots
60 dots 240 commons (Dots) 60 dots
60 dots
240 segments (Dots)
Figure 3.14.24 Display Reference below Sample Program
92C820-274
2007-02-16
TMP92C820
3.14.4.8 Sample Program
* Setting example: In case of use 240 segments x 240 commons, 4-level grayscale display, 64-Mbit SDRAM.
2H
This sample program operate correctly, LCD panel shows Figure 3.14.18 display. ;***** SDRAM SET ***** ld (sdacr), 2bH ld (sdrcr), 01H ;***** GLCDC SET ***** ld (lcdmode), 17H ld (lcddvm), 11 ld (lcdsize), 32H ld (lcdctl), 20H ld (lcdffp), 240 ld (lcdgl), 01H ld (lcdcm), 0c1H ld (lcdcw), 19 ld (lcdch), 19 ld (lcdcp), 00H ld (lcdcpl), 00H ld (lcdcpm), 00H ld (lcdcph), 40H ld (lsarch), 40H ld (lsarcm), 00H ld (lsarcl), 00H ;***** 0/4 data write 60 ROW ***** ld xix, 400000H ld wa, 0000H loop1: ld (xix), wa inc 2, xix cp xix, 407800H jr nz, loop1 ;***** 2/4 data write 60 ROW ***** ld xix, 407800H ld wa, 05555H loop2: ld (xix), wa inc 2, xix cp xix, 40F000H jr nz, loop2 ;***** 3/4 data write 60 ROW ***** ld xix, 40F000H ld wa, 0aaaaH loop3: ld (xix), wa inc 2, xix cp xix, 416800H jr nz, loop3
; Add-MUX enable, 64-Mbit select ; Interval refresh
; A/B area OFF, SDRAM 64 Mbits, SR type ; SCP width 2clocks ; 11-count DVM set ; COM = 240, SEG = 240 ; Divide frame ON, display OFF ; Frame frequency correction (91 Hz) ; 4-level grayscale ; Cursor ON, Black, 2 Hz blink ; Width = 20 dots ; Height = 20 dots ; Pixel = 0 ; Cursor address ; Cursor address ; Cursor address ; C_area start address ; C_area start address ; C_area start address ; ; Write data 0/4-level data (0000000000000000B) ; ; ; 400000H to 4077FFH: 60 rows (Dots) ; ; ; Write data 1/4-level data (0101010101010101B) ; ; ; 407800H to 40EFFFH: 60 rows (Dots) ; ; ; Write data 2/4-level data (1010101010101010B) ; ; ; 40F000H to 4167FFH: 60 rows (Dots) ;
92C820-275
2007-02-16
TMP92C820
;***** 4/4 data write 60 ROW ***** ld xix, 416800H ; ld wa, 0ffffH ; Write data 3/4-level data (1111111111111111B) loop4: ld (xix), wa ; inc 2, xix ; cp xix, 41e000H ; 416800H to 41DFFFH: 60 rows (Dots) jr nz, loop4 ; ;***** 4-level gray palette pattern set ***** ld (lg0l), 00H ; 0/4 grayscale palette 0000B ld (lg1l), 05H ; 2/4 grayscale palette 0101B ld (lg2l), 0eH ; 3/4 grayscale palette 1110B ld (lg3l), 0fH ; 4/4 grayscale palette 1111B ;***** DMA, DISPLAY-ON start ***** ld (lcdctl), 0a1H ; Display ON, divide ON
92C820-276
2007-02-16
TMP92C820 3.14.5 RAM Built-in Type LCD Driver Control Mode (RAM mode)
Data transmission to LCD driver is executed by move instruction of CPU. After setting mode of operation to control register, when move instruction of CPU is executed LCDC outputs chip select signal to LCD driver connected to the outside from control pin (D1BSCP etc.). Therefore control of data transmission numbers corresponding to LCD size is controlled by instruction of CPU. There are 2 kinds of address of LCD driver in this case, and which is chosen determines by LCDCTL register. It corresponds to LCD driver which has every 1 byte of instruction register and display data register in LCD driver at the time of = "0". Please make the transmission place address at this time into either of FE0H to FE7F. (SEQUENTIAL ACCESS TYPE: See Table 3.14.4.) It corresponds to address direct writing type LCD driver at the time of = "1." The transmission place address at this time can also assign the memory area of 3C0000H to 3FFFFF to four area for every 64 Kbytes. (RANDOM ACCESS TYPE)
23H
3.14.5.1 Operation
Note:
24H
This operation mode cannot use cursor function.
25H
Figure 3.14.25 shows access timing example in = "0". Also, Figure 3.14.26 shows example of connection.
[Write cycle] System clock: fSYS A23 to A0 R/W D1BSCP, D2BLP, D3BFR, DLEBCD D7 to D0 Data-out Data-in [Read cycle]
Note 1: Note 2:
This waveform is the case of 3-state access. Note the different rising timing for D1BSCP etc.
Figure 3.14.25 Example of Access Timing for RAM Built-in Type LCD Driver (Wait = 0)
92C820-277
2007-02-16
TMP92C820
3.14.5.2 Examples to Use
TMP92C820 VDD VSS T6B66A (65-row driver) VDD COM001 VSS 65 COM x 80 SEG LCD Power circuit VLC1, VLC2, VLC3, VLC4, VLC5 DB0 to DB5 COM065
DSPOF
COM001
SEG001
COM065
WR
LE
SEG001
DLEBCD D1BSCP
WR
CE WR
A0
DOFF
D/I
DSPOF
D0 to D7 Open
VDD
VDD VSS Power circuit T6B65A (80-column driver)
Note: Other circuit is necessary for LCD drive power supply for LCD driver display.
Figure 3.14.26 Interface Example for RAM Built-in Type Sequential Access Type LCD Driver
VSS
DB0 to DB7 EIO1 EIO2
92C820-278
VLC2, VLC3 SEG080 VLC5
SEG080
2007-02-16
TMP92C820
3.14.5.3 Sample Program
* Setting example: In case of use 80 segment x 65 commons LCD driver. Assign external column driver to LCDC1 and row driver to LCDR1. This example used LD instruction in setting of instruction and used burst function of micro DMA by soft start in setting of display data.
In case of store 650 bytes transfer data to LCD driver. ; Setting external terminal LD (PDFC), 19H
; CE for LCDC1: D1BSCP, ; LE for LCDR1: DLEBCD, ; Setting for DOFF ; Select RAM mode ; Sequential access mode ; Setting instruction for LCDC1 ; Setting instruction for LCDR1 ; Source address INC mode ; ; Count = 650 ; ; Source address = 400000H ; ; Destination address = 1FE1H (LCDC0H) ; ; INTTC0 level = 6 ; Interrupt level = 6 ; Burst mode ; Soft start
; Setting for LCDC LD (LCDMODE), 00H LD (LCDCTL), 00H ; Setting for mode of LCDC1/LCDR1 LD (LCDC1L), XX LD (LCDR1L), XX ; Setting for micro DMA and INTTC (ch0) LD A, 08H LDC DMAM0, A LD WA, 650 LDC DMAC0, WA LD XWA, 400000H LDC DMAS0, XWA LD XWA, 1FE1H LDC DMAD0, XWA LD (INTETC01), 06H EI 6 LD (DMAB), 01H LD (DMAR), 01H
92C820-279
2007-02-16
TMP92C820
3.15 Melody/Alarm Generator (MLD)
The TMP92C820 contains a melody function and alarm function, both of which are output from the MLDALM pin. Five kinds of fixed cycle interrupt are generated using a 15-bit counter for use as the alarm generator. The features are as follows. 1) Melody generator The Melody function generates signals of any frequency (4 Hz to 5461 Hz) based on a low-speed clock (32.768 kHz), and outputs the signals from the MLDALM pin. The melody tone can easily be heard by connecting an external loudspeaker. 2) Alarm generator The alarm function generates eight kinds of alarm waveform having a modulation frequency (4096 Hz) determined by the low-speed clock (32.768 kHz). This waveform can be inverted by setting a value to a register. The alarm tone can easily be heard by connecting an external loudspeaker. Five kinds of fixed cycle interrupts are generated (1 Hz, 2 Hz, 64 Hz, 512 Hz, and 8192 Hz) by using a counter which is used for the alarm generator. This section is constituted as follows. 3.15.1 Block Diagram
0H 1H
3.15.2 Control Registers
2H 3H
3.15.3 Operational Description
4H 5H
3.15.3.1 Melody Generator
6H 7H
3.15.3.2 Alarm Generator
8H 9H
92C820-280
2007-02-16
TMP92C820 3.15.1 Block Diagram
Melody generator
Reset Internal data bus
MELFH, MELFL register MELOUT MELFH Stop and clear Low-speed clock Invert Comparator (CP0) F/F
12-bit counter (UC0)
Clear
Alarm generator
INTALM0 (8192Hz) INTALM1 (512 Hz) INTALM2 (64 Hz) INTALM3 (2 Hz) INTALM4 (1 Hz) 15-bit counter (UC1) 4096 Hz MELALMC 8-bit counter (UC2) MELOUT Alarm waveform generator Selector Invert ALMOUT MELALMC MELALMC MLDALM pin ALMINT INTALMH (HALT release)
ALM register
Internal data bus
Reset
Figure 3.15.1 MLD Block Diagram
Edge detector
92C820-281
2007-02-16
TMP92C820 3.15.2 Control Registers
ALM Register 7
ALM (1330H) Bit symbol Read/Write After reset Function 0 0 0 0 AL8
6
AL7
5
AL6
4
AL5 R/W
3
AL4 0
2
AL3 0
1
AL2 0
0
AL1 0
Setting alarm pattern
MELALMC Register 7
MELALMC Bit symbol (1331H) Read/Write After reset Function FC1 R/W 0 00: Hold 01: Restart 10: Clear 11: Clear and start Note 1: Note 2: MELALMC is always read "0". When setting MELALMC register except while the free-run counter is running, is kept "01". 0 Free-run counter control
6
FC0
5
ALMINV R/W 0 Alarm waveform invert 1: Invert
4
- 0
3
- R/W 0
2
- 0
1
- 0
0
MELALM R/W 0 Output waveform select 0: Alarm 1: Melody
Always write "0"
MELFL Register 7
MELFL (1332H) Bit symbol Read/Write After reset Function 0 0 0 0 ML7
6
ML6
5
ML5
4
ML4 R/W
3
ML3 0
2
ML2 0
1
ML1 0
0
ML0 0
Setting melody frequency (Lower 8 bits)
MELFH Register 7
MELFH (1333H) Bit symbol Read/Write After reset Function MELON R/W 0 Control melody counter 0: Stop and clear 1: Start Setting melody frequency (Upper 4 bits) 0 0
6
5
4
3
ML11
2
ML10 R/W
1
ML9 0
0
ML8 0
ALMINT Register 7
ALMINT (1334H) Bit symbol Read/Write After reset Function
6
5
- R/W 0 Always write "0"
4
IALM4E 0
3
IALM3E 0
2
IALM2E R/W 0
1
IALM1E 0
0
IALM0E 0
1: Interrupt enable for INTALM4 to INTALM0
92C820-282
2007-02-16
TMP92C820 3.15.3 Operational Description
The Melody function generates signals of any frequency (4 Hz to 5461 Hz) based on a low-speed clock (32.768 kHz) and outputs the signals from the MLDALM pin. The melody tone can easily be heard by connecting an external loud speaker.
3.15.3.1 Melody Generator
(Operation) MELALMC must first be set as 1 in order to select the melody waveform to be output from MLDALM. The melody output frequency must then be set to 12-bit registers MELFH and MELFL. The following are examples of settings and calculations of melody output frequency. (Formula for calculating of melody waveform frequency)
at fs = 32.768 [kHz] Melody output waveform Setting value for melody fMLD [Hz] = 32768/(2 x N + 4) N = (16384/ fMLD) - 2
(Note: N = 1 to 4095 (001H to FFFH), 0 is not acceptable.)
(Example program)
When outputting an "A" musical note (440 Hz) LD LD LD (MELALMC), - - X X X X X 1 B (MELFL), 23H (MELFH), 80H ; Select melody waveform ; N = 16384/440 - 2 = 35.2 = 023H ; Start to generate waveform
(Reference: Basic Musical Scale Setting Table) Scale
C D E F G A B C
Frequency [Hz]
264 297 330 352 396 440 495 528
Register Value: N
03CH 035H 030H 02DH 027H 023H 01FH 01DH
92C820-283
2007-02-16
TMP92C820
3.15.3.2 Alarm Generator The alarm function generates eight kinds of alarm waveform having a modulation frequency of 4096 Hz determined by the low-speed clock (32.768 kHz). This waveform is reversible by setting a value to a register. The alarm tone can easily be heard by connecting an external loud speaker . Five kinds of fixed cycle (interrupts can be generated 1 Hz, 2 Hz, 64 Hz, 512 Hz, 8 192 Hz) by using a counter which is used for the alarm generator. (Operation) MELALMC must first be set as 0 in order to select the alarm waveform to be output from MLDALMC. The "10" must be set on the MELALMC register, and clear internal counter. Finally the alarm pattern must then be set on the 8-bit register of ALM. If it is inverted output-data, set as invert. The following are examples of program, setting value of alarm pattern and waveform of each setting value. (Setting Value of Alarm Pattern) Setting Value for ALM Register
00H 01H 02H 04H 08H 10H 20H 40H 80H Other
Alarm Waveform
"0" fixed AL1 pattern AL2 pattern AL3 pattern AL4 pattern AL5 pattern AL6 pattern AL7 pattern AL8 pattern Undefined (do not set)
(Example program)
When outputting AL2 pattern (31.25 ms/8 times/1 s) LD LD (MELALMC), C0H (ALM), 02H ; Set output alarm waveform ; Free-run counter start ; Set AL2 pattern, start
92C820-284
2007-02-16
TMP92C820
Example: Waveform of alarm pattern for each setting value: Not inverted
AL1 pattern (Continuous output) AL2 pattern (31.25 ms/8 times/1 s) 1 2
frequency (4096 Hz)
8
1
31.25 ms AL3 pattern (500 ms/once) 1 1
1s
500 ms AL4 pattern (62.5 ms/twice/1 s) 2 1
62.5 ms AL5 pattern (62.5 ms/3 times/1 s) 1 2 3
1s 1
62.5 ms AL6 pattern (62.5 ms/once) 1
1s
62.5 ms AL7 pattern (62.5 ms/twice) 1 2
62.5 ms AL8 pattern (250 ms/once) 250 ms
92C820-285
2007-02-16
TMP92C820
3.16 SDRAM Controller (SDRAMC)
TMP92C820 includes SDRAM controller which supports SDRAM access by CPU/LCDC. The features are as follows. (1) Support SDRAM 16-M/64-M/128-Mbit SDRAM (x 16 bits x 2/4 banks) 64-M/128-Mbit SDRAM (x 32 bits x 4 banks) (2) Automatic initialize function * * * All bank pre-charge command generate Mode register set generate 8 times auto refresh
(3) Access mode CPU Access
Burst length Addressing mode Cas latency (Clock) Write mode 1 word Sequential 2 Single write
LCDC Access
Full page Sequential 2 -
(4) Access cycle * CPU access (Read/write) Read cycle: 4 states (200 ns at fSYS =20 MHz) Write cycle: 3 states (150 ns at fSYS =20 MHz) Access data width: 8 bits/16 bits/32 bits * LCDC burst access (Read only) Read cycle: 1 state (50 ns at fSYS =20 MHz) Over head: 4 states (200 ns at fSYS =20 MHz) Access data width: 16 bits/32 bits (5) Refresh cycle auto generate * * * Auto refresh is generated while another area is being accessed. Refresh interval is programmable. Self refresh is supported
Notes: * * *
Display data for LCDC must be set from the head of each page. Program is not operated on SDRAM. Condition of SDRAM's area is set by CS1 setting of Memory Controller.
92C820-286
2007-02-16
TMP92C820 3.16.1 Control Registers
Figure 3.16.1 shows the SDRAMC control registers. Setting these registers controls the operation of SDRAMC.
0H
SDRAM Access Control Register 7
SDACR (0250H) Bit symbol Read/Write After reset Function SDINI R/W 0 Auto initialize 0: Disable 1: Enable 0
6
5
SDBUS1 R/W
4
SDBUS0 0
3
2
SMUXW1 0 Selecting address multiplex type 00: Type A 01: Type B 10: Type C 11: Reserved R/W
1
SMUXW0 0
0
SMAC R/W 0 SDRAM controller 0: Disable 1: Enable
Selecting structure of data bus 00: 16 bits x 1 01: 16 bits x 2 10: 32 bits x 1
SDRAM Refresh Control Register 7
SDRCR (0251H) Bit symbol Read/Write After reset Function SFRC R/W 0 0 Self refresh Refresh interval 0: Disable 000: 78 states 1: Enable 001: 97 states 010: 124 states 011: 156 states
6
SRS2
5
SRS1 R/W 0
4
SRS0 0
3
SASFRC R/W 0 Auto self refresh 0: Disable 1: Enable
2
1
0
SRC R/W 0 Interval refresh 0: Disable 1: Enable
100: 195 states 101: 210 states 110: 249 states 111: 312 states
Figure 3.16.1 SDRAMC Control Registers
92C820-287
2007-02-16
TMP92C820 3.16.2 Operation Description
(1) Memory access control Access control block is enabled when SDACR = 1. And then SDRAM control signals (SDCSL, SDCSH, SDRAS, SDCAS, SDWE, SDLLDQM, SDLUDQM, SDULDQM, SDUUDQM, SDCLK and SDCKE) are operating during the time CPU or LCDC accesses CS1 area. 1. Address multiplex function
In the access cycle, address multiplex outputs row/column address through A1 to A15 pin. And multiplex width is decided by setting SDACR of use memory size. The relation between multiplex width and memory sizeRow/Column address is below. Table 3.16.1 Address Multiplex Address of SDRAM Accessing Cycle 92C820 Pin Name Column Address Row Address
Type A Type B Type C SDACR SDACR SDACR = "00" = "01" = "10" A0 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A23 A0 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A23 A15 A0 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A23 A14 A15
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15
2. Burst length SDRAM access by CPU is performed by the 1-word burst mode. And SDRAM access by LCDC is performed by the full-page burst mode. SDRAM access cycle is shown in Figure 3.16.2 to Figure 3.16.3.
1H 2H
SDRAM accessing cycle number is depending on B1CSL register setting. For read cycle, setting of 4 states is necessary (B1CSL). For write cycle, setting of 3 states is necessary (B1CSL). In the burst read cycle by LCDC, a mode setup and a pre-charge cycle are automatically inserted in a read cycle front and back.
92C820-288
2007-02-16
TMP92C820
4 states SDCLK SDCKE SDLUDQM SDLLDQM SDCSL SDRAS SDCAS SDWE A11 A1 to A15 D0 to D15 RA RA CA IN CA
Bank active
RD with precharge
Internal precharge
Figure 3.16.2 Timing of CPU Read Cycle
(Structure of data bus: 16 bits x 1, Operand size: 2 bytes, Address: 2 n + 0)
3 states SDCLK SDCKE SDLUDQM SDLLDQM SDCSL SDRAS SDCAS SDWE A11 A1 to A15 D0 to D15 Bank active RA RA OUT CA CA
WR with precharge
Internal precharge
Figure 3.16.3 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 1, Operand size: 2 bytes, Address: 2 n + 0)
92C820-289
2007-02-16
TMP92C820
SDCLK SDCKE SDLUDQM SDLLDQM SDCSL SDRAS SDCAS SDWE A11 A15 to A1 D15 to D8 D7 to D0 RA RA OUT OUT CA CA RA RA CA CA
Figure 3.16.4 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 1, Operand size: 2 bytes, Address: 2 n + 1)
SDCLK SDCKE SDLUDQM SDLLDQM SDCSL SDRAS SDCAS SDWE A11 A15 to A1 D15 to D8 D7 to D0 RA RA OUT CA CA
Figure 3.16.5 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 1, Operand size: 1 byte, Address: 2 n + 1)
92C820-290
2007-02-16
TMP92C820
4 states SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSH SDCSL SDRAS SDCAS SDWE A12 A2 to A15 D0 to D31 RA RA CA IN CA
Bank active
RD with precharge
Internal precharge
Figure 3.16.6 Timing of CPU Read Cycle
(Structure of data bus: 16 bits x 2 = 32 bits, Operand size: 4 bytes, Address: 4 n + 0)
3 states SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSH SDCSL SDRAS SDCAS SDWE A12 A2 to A15 D0 to D31 Bank active RA RA OUT CA CA
WR with precharge
Internal precharge
Figure 3.16.7 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 2 = 32 bits, Operand size: 4 bytes, Address: 4 n + 0)
92C820-291
2007-02-16
TMP92C820
SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSH SDCSL SDRAS SDCAS SDWE A12 A15 to A2 D31 to D24 D23 to D16 D15 to D8 D7 to D0 RA RA OUT OUT OUT OUT CA CA RA RA CA CA
Figure 3.16.8 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 2 = 32 bits, Operand size: 4 bytes, Address: 4 n + 1)
SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSH SDCSL SDRAS SDCAS SDWE A12 A15 to A2 D31 to D24 D23 to D16 D15 to D8 D7 to D0 OUT RA RA CA CA
Figure 3.16.9 Timing of CPU Write Cycle
(Structure of data bus: 16 bits x 2 = 32 bits, Operand size: 8 bytes, Address: 4 n + 3)
92C820-292
2007-02-16
TMP92C820
4 states SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM
SDCSL SDRAS SDCAS SDWE A12 A2 to A15 D0 to D31 RA RA CA IN CA
Bank active
RD with precharge
Internal precharge
Figure 3.16.10 Timing of CPU Read Cycle
(Structure of data bus: 32 bits x 1, Operand size: 4 bytes, Address: 4 n + 0)
3 states SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM
SDCSL SDRAS SDCAS SDWE A12 A2 to A15 D0 to D31 RA RA OUT CA CA
Bank active
WR with precharge
Internal precharge
Figure 3.16.11 Timing of CPU Write Cycle
(Structure of data bus: 32 bits x 1, Operand size: 4 bytes, Address: 4 n + 0)
92C820-293
2007-02-16
TMP92C820
SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM
SDCSL SDRAS SDCAS SDWE A12 A15 to A2 D31 to D24 D23 to D16 D15 to D8 D7 to D0 RA RA OUT OUT OUT OUT CA CA RA RA CA CA
Figure 3.16.12 Timing of CPU Write Cycle
(Structure of data bus: 32 bits x 1, Operand size: 4 bytes, Address: 4 n + 1)
SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM
SDCSL SDRAS SDCAS SDWE A12 A15 to A2 D31 to D24 D23 to D16 D15 to D8 D7 to D0 OUT RA RA CA CA
Figure 3.16.13 Timing of CPU Write Cycle
(Structure of data bus: 32 bits x 1, size: 8 bytes, Address: 4 n + 3)
92C820-294
2007-02-16
TMP92C820
85 states (320-byte read) SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSL SDCSH SDRAS SDCAS SDWE A11 A1 to A15 D0 to D31 227 RA RA
CA (n)
CA (n + 4) CA (n + 8)
CA (n + 12)
......
D (n + 8)
(n + 312) D (n + 12)
(n + 316)
220
D (n + 312) D (n + 316)
D (n)
D (n + 4)
......
Full page mode set
Bank active
RD
All bank 1-word precharge mode set
Figure 3.16.14 Timing of LCDC Burst Read Cycle
92C820-295
2007-02-16
TMP92C820
(2) Refresh control TMP92C820 can generate automatically an auto-refresh cycle for data maintenance of SDRAM. Auto-refresh cycle is generated by setting SDRCR to "1". Interval of auto refresh can be set by SDRCR from the 78 states to the 312 states (3.9 s to 15.6 s at 20 MHz). The generating timing of an auto-refresh cycle becomes into accessing cycles other than SDRAM area (CS1). The auto-refresh cycle is shown in Figure 3.16.15 moreover, the interval of auto refresh is shown in Table 3.16.2.
3H 4H
2 states SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSL SDCSH SDRAS SDCAS SDWE Auto refresh
Figure 3.16.15 Timing of Auto-refresh Cycle Table 3.16.2 Refresh Cycle Insertion Interval
(Unit: s) SDRCR SRS2 0 0 0 0 1 1 1 1 SRS1 0 0 1 1 0 0 1 1 SRS0 0 1 0 1 0 1 0 1 Insertion Interval (State) 78 97 124 156 195 210 247 312 5 MHz 15.6 19.4 24.8 31.2 39.0 42.0 49.4 62.4 10 MHz 7.8 9.7 12.4 15.6 19.5 21.0 24.7 31.2 fSYS Frequency (System clock) 12.5 MHz 6.2 7.8 9.9 12.5 15.6 16.8 19.8 25.0 15 MHz 5.2 6.5 8.3 10.4 13.0 14.0 16.5 20.8 17.5 MHz 4.5 5.5 7.1 8.9 11.1 12.0 14.1 17.8 20 MHz 3.9 4.9 6.2 7.8 9.8 10.5 12.4 15.6
It does not generate an auto-refresh cycle during the burst access to SDRAM by LCDC. The demand of auto-refresh cycle is held in this period. When it returns to CPU access cycle, an auto-refresh cycle is generated. Furthermore, TMP92C820 can to generate a self-refresh cycle. The timing of a self-refresh cycle is shown in Figure 3.16.16.
5H
92C820-296
2007-02-16
TMP92C820
SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSL SDCSH SDRAS SDCAS SDWE
Self-refresh entry
Self-refresh exit
Auto refresh
Figure 3.16.16 Timing of Self-refresh Cycle Note 1: When IDLE2 mode, continue with output clock. Therefore, If want to stop SDCLK, switch PF6 to output port before execution HALT instruction. Note 2: Pin condition in IDLE1/STOP mode depends on SYSCR2 setting. However, when self-refresh mode, pin don't depend on SYSCR2, and output low level. If SDRCR is set to "1", the self-refresh cycle shown in Figure 3.16.16 will occur. The self-refresh mode is used when using the standby mode (STOP, IDLE1), which an internal clock stops. In the case of standby mode using self refresh, please set SDRCR to "1", before HALT instruction (STOP, IDLE1).
6H
Release of a self-refresh cycle is automatically performed by release in the standby mode. It inserts automatically one auto refresh after self refresh is released, and returns to the auto refresh mode. Note: When standby mode is cancelled by a reset, the I/O registers are initialized, therefore, auto refresh is not performed.
Please do not place the command which accesses SDRAM, just before setting SDRCR to "1". After setting SDRCR to "1", at least 4 times of "NOP (s)" are required before halt command execution. Example: SET 7, (SDRCR) NOP NOP * at least 4 times NOP(s). NOP NOP HALT
92C820-297
2007-02-16
TMP92C820
(3) SDRAM initialize TMP92C820 can generate the following SDRAM initialize routine after injection power-supply to SDRAM. The cycle is shown in Figure 3.16.17.
7H
1. 2. 3.
Precharge of all banks The initial configuration to a mode register The auto-refresh cycle of 8 cycles
The above cycle is generated by setting SDACR to "1". While performing this cycle, operation (an instruction fetch, command execution) of CPU is stopped. In addition, before performing an initialization cycle, a port needs to be set as SDRAM control signal and an address signal (A1 to A12). After the initialization cycle is finished, SDACR is cleared to "0" automatically.
8 times refresh cycle SDCLK SDCKE SDUUDQM SDULDQM SDLUDQM SDLLDQM SDCSL SDCSH SDRAS SDCAS SDWE A11 A1 to A15 620 220
All bank precharge
1-word mode set
Auto refresh
Auto refresh
Auto refresh
Auto refresh
Auto refresh
Figure 3.16.17 Timing of Initialization Cycle
92C820-298
2007-02-16
TMP92C820
(4) Connection example The example of connection with SDRAM is shown in Figure 3.16.18 to Figure 3.16.20.
8H 9H
Table 3.16.3 Connection with SDRAM SDRAM Pin Name TMP92C820 Pin Name
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 SDCSH SDCSL SDUUDQM SDULDQM SDLUDQM SDLLDQM SDRAS SDCAS SDWE SDCKE SDCLK SDACR SDACR (An):
00: 16 bits x 1 00: Type A
Data Bus Width 16 Bits
16 Mbits - A0 (A9) A1 (A10) A2 (A11) A3 (A12) A4 (A13) A5 (A14) A6 (A15) A7 (A16) A8 (A17) A9 (A18) A10 (A19) BS (A20) - - - - CS - - UDQM LDQM RAS CAS WE CKE CLK
00: 16 bits x 1 00: Type A
Data Bus Width 32 Bits
16 Mbits x 16 Bits x 2 - - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) BS (A21) - - CS - UDQM LDQM UDQM LDQM RAS CAS WE CKE CLK
01: 16 bits x 2 00: Type A
64 Mbits - A0 (A9) A1 (A10) A2 (A11) A3 (A12) A4 (A13) A5 (A14) A6 (A15) A7 (A16) A8 (A17) A9 (A18) A10 (A19) A11 (A20) BS0 (A21) BS1 (A22) - - CS - - UDQM LDQM RAS CAS WE CKE CLK
128 Mbits - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) A11 (A21) BS0 (A22) BS1 (A23) - - CS - - UDQM LDQM RAS CAS WE CKE CLK
00: 16 bits x 1 01: Type B
64 Mbits x 16 Bits x 2 - - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) A11 (A21) BS0 (A22) BS1 (A23) CS - UDQM LDQM UDQM LDQM RAS CAS WE CKE CLK
01: 16 bits x 2 00: Type A
64 Mbits x 32 Bits - - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) BS0 (A21) BS1 (A22) - - CS DQM3 DQM2 DQM1 DQM0 RAS CAS WE CKE CLK
10: 32 bits x 1 00: Type A
128 Mbits x 32 Bits - - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) A11 (A21) BS0 (A22) BS1 (A23) - CS DQM3 DQM2 DQM1 DQM0 RAS CAS WE CKE CLK
10: 32 bits x 1 00: Type A
- - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) BS (A21) - - - CS
- - A0 (A10) A1 (A11) A2 (A12) A3 (A13) A4 (A14) A5 (A15) A6 (A16) A7 (A17) A8 (A18) A9 (A19) A10 (A20) A11 (A21) BS0 (A22) BS1 (A23) - CS
RAS CAS WE CKE CLK
RAS CAS WE CKE CLK
Row address : Command address pin of SDRAM
92C820-299
2007-02-16
TMP92C820
TMP92C820 SDCLK SDCKE (A22) A14 (A21) A13 A12 to A1 D15 to D0
SDRAS SDCAS SDWE SDCSL
SDRAM CLK CKE BS1 BS0 A11 to A0 D15 to D0
RAS CAS WE CS
SDLUDQM SDLLDQM
UDQM LDQM 1 Mwords x 4 banks x 16 bits
Figure 3.16.18 Connection with SDRAM (1 Mwords x 16 bits)
TMP92C820 SDCLK SDCKE (A23) A15 (A22) A14 A13 to A2 D31 to D0
SDRAS SDCAS SDWE SDCSH
SDRAM CLK CKE BS1 BS0 A11 to A0 D15 to D0
RAS CAS WE CS
SDUUDQM SDULDQM
SDCSL
UDQM LDQM SDRAM CLK CKE BS1 BS0 A11 to A0 D15 to D0
RAS CAS WE CS
SDLUDQM SDLLDQM
UDQM LDQM
Figure 3.16.19 Connection with SDRAM (1 Mwords x 16 bits x 2)
1 Mwords x 4 banks x 16 bits
1 Mwords x 4 banks x 16 bits
92C820-300
2007-02-16
TMP92C820
TMP92C820 SDCLK SDCKE (A22) A14 (A21) A13 A12 to A2 D31 to D0
SDRAS SDCAS SDWE SDCSL
SDRAM CLK CKE BS1 BS0 A10 to A0 D31 to D0
RAS CAS WE CS
SDUUDQM SDULDQM SDLUDQM SDLLDQM
DQM3 DQM2 DQM1 DQM0 512 kwords x 4 banks x 32 bits
Figure 3.16.20 Connection with SDRAM (512 kwords x 32 bits)
92C820-301
2007-02-16
TMP92C820
(5) Limitation point for SDRAM There are some points to notice when using SDRAMC. Please refer to the section under below and take care. 1) WAIT access When using SDRAM, it is added some limitation of access to all other memories. Under the WAIT pin input setting of Memory Controller, it is prohibited inserting the time over (14 x refresh interval time; in Auto Refresh function controlled by SDRAM controller). 2) Execution of SDRAM command before HALT instruction (SR(Self refresh)-Entry , Initialize , Mode-set) It requires execution time (a few states) to execute the command that SDRAMC has (SR- Entry, Initialize). Therefore when executing HALT instruction after the SDRAM command, please insert over 10 bytes NOP or other 10 bytes instructions before HALT instruction. 3) AR (Auto Refresh) interval time When using SDRAM, system clock frequency must be set suitable speed for SDRAM's specification that is minimum operating clock and minimum Refresh interval time. When using SDRAM under slow mode or down the Clock Gear, please design the system with special care for Auto Refresh interval time. And please set Auto Refresh interval time after adding 10 states to distributed Auto Refresh interval time, because it might not meet the A.C specification of SDRAM by stopping Auto Refresh. (Example of calculation) Condition: fSYS = 20MHz, SDRAM specification of distributed Auto Refresh interval time = 4096 times/64 ms 64ms/ 4096 times = 15.625s/1 time = 312.5state/1 time 312.5 - 10 = 302.5 state/less than 1 time is needed 247 state is needed
92C820-302
2007-02-16
TMP92C820
4) Auto Exit problem when exiting from Self Refresh Mode of SDRAM When using Self Refresh function together with stand-by function of CPU or changing clock, it might not be suit specification of SDRAM. Because automatic releasing Self Refresh function (Auto Exit function) operates by CPU releasing HALT mode. Following figure shows example for avoid this problem by S/W. (Outline concept to control)
Gear-down or Change to Low clock fSYS 20MHz 32KHz CPU SR ENTRY
Change to Change port CLK
Gear-up or Change to High clock
Interrupt
HALT
SR ENTRY
HALT mode
Change CLK
Change to port
SR EXIT
Port condition SDRAM control pin General port setting SDRAM control pin
SDRAM controller internal condition AR condition SR condition AR condition SR condition AR condition
Auto EXIT SDRAM condition AR condition SR condition AR condition
*The target ports to change are SDCKE pin and SDCS pin.
*The method of Self refresh Entry includes the condition 4). * SR : Self refresh , AR : Auto refresh
92C820-303
2007-02-16
TMP92C820
3.17 16-Bit Timer/Event Counters (TMRB)
The TMP92C820 incorporates one multifunctional 16-bit timer/event counter (TMRB0) which have the following operation modes: * * * 16-bit interval timer mode 16-bit event counter mode 16-bit programmable pulse generation (PPG) mode
Timer/event counter consists of a 16-bit up counter, two 16-bit timer registers (one of them with a double-buffer structure), a 16-bit capture registers, two comparators, a capture input controller, a timer flip-flop and a control circuit. Timer/event counter is controlled by an 11-byte control SFR. This chapter consists of the following items: 3.17.1 Block Diagram 3.17.2 Operation 3.17.3 SFRs 3.17.4 Operation in Each Mode (1) 16-bit timer mode (2) 16-bit programmable pulse generation (PPG) output mode
Table 3.17.1 Pins and SFR of TMRB0
Channel Spec External clock/capture trigger input pins Timer flip-flop output pins Timer run register Timer mode register Timer flip-flop control register None TB0OUT0 (also used as PC6) TB0RUN (1180H) TB0MOD (1182H) TB0FFCR (1183H) TB0RG0L (1188H) SFR (Address) Timer register TB0RG0H (1189H) TB0RG1L (118AH) TB0RG1H (118BH) TB0CP0L (118CH) Capture register TB0CP0H (118DH) TB0CP1L (118EH) TB0CP1H (118FH) TMRB0
External Pins
92C820-304
2007-02-16
3.17.1
Block Diagram
Internal data bus
Internal data bus
INT output Register 0 Register 1 INTTB01 INTTB00
Prescaler clock: T0 2 4 T4 Capture register 0 TB0CP0H/L Caputure register 1 TB0CP1H/L TB0MOD
Capture, external INT input control
8 T16
Run/ clear TB0RUN 16 32
T1
External INT input INT7 (Unused), INT8 (Unused)
Timer flip-flop TB0FF0 Timer flip-flop control TB0FF1
Timer flip-flop output TB0OUT0 TB0OUT1 (Unused) Overflow INT INTTBOF0
TA1OUT Slelector Count clock 16-bit up counter (UC10) TB0RUN TB0MOD
(from TMRA01)
Figure 3.17.1 Block Diagram of TMRB0
TB1MOD T1 T4 T16 TB0MOD Match detection
16-bit comparator (CP10) 16-bit comparator (CP11)
92C820-305
16-bit timer register TB0RG0H/L
Match detection
16-bit time register TB0RG1H/L
TB0RUN
Register buffer 10
TMP92C820
2007-02-16
Internal data bus
Internal data bus
TMP92C820 3.17.2 Operation
(1) Prescaler The 5-bit prescaler generates the source clock for timer 0. The prescaler clock (T0) is divided clock (Divided by 8) from the fFPH. This prescaler can be started or stopped using TB0RUN. Counting starts when is set to 1; the prescaler is cleared to 0 and stops operation when is cleared to 0.
Table 3.17.2 Prescaler Clock Resolution
Clock gear selection SYSCR1 - 000 (1/1) 001 (1/2) 010 (1/4) 011 (1/8) 100 (1/16) 0 (fc) 1/8 System clock selection SYSCR1 1 (fs)
Timer counter input clock TMRB prescaler - TB0MOD T1(1/2)
fs/16 fc/16 fc/32 fc/64 fc/128 fc/256
T4(1/8)
fs/64 fc/64 fc/128 fc/256 fc/512 fc/1024
T16(1/32)
fs/256 fc/256 fc/512 fc/1024 fc/2048 fc/4096
(2) Up counter (UC10) UC10 is a 16-bit binary counter which counts up pulses input from the clock specified by TB0MOD. Any one of the prescaler internal clocks T1, T4 and T16 or an external clock input via the TB0IN0 pin can be selected as the input clock. Counting or stopping and clearing of the counter is controlled by TB0RUN. When clearing is enabled, the up counter UC10 will be cleared to 0 each time its value matches the value in the timer register TB0RG1H/L. If clearing is disabled, the counter operates as a free-running counter. Clearing can be enabled or disabled using TB0MOD. A timer overflow interrupt (INTTBOF0) is generated when UC10 overflow occurs.
92C820-306
2007-02-16
TMP92C820
(3) Timer registers (TB0RG0H/L and TB0RG1H/L) These two 16-bit registers are used to set the interval time. When the value in the up counter UC10 matches the value set in this timer register, the comparator match detect signal will go active. Setting data for both Upper and Lower timer registers is always needed. For example, either using a 2-byte data transfer instruction or using 1-byte date transfer instruction twice for the lower 8 bits and upper 8 bits in order. The TB0RG0H/L timer register has a double-buffer structure, which is paired with a register buffer. The value set in TB0RUN determines whether the double-buffer structure is enabled or disabled: It is disabled when = 0, and enabled when = 1. When the double buffer is enabled, data is transferred from the register buffer to the timer register when the values in the up counter (UC10) and the timer register TB0RG1H/L match. After a reset, TB0RG0H/L and TB0RG1H/L are undefined. If the 16-bit timer is to be used after a reset, data should be written to it beforehand. On a reset is initialized to 0, disabling the double buffer. To use the double buffer, write data to the timer register, set to 1, then write data to the register buffer as shown below. TB0RG0H/L and the register buffer both have the same memory addresses (001188H and 001189H) allocated to them. If = 0, the value is written to both the timer register and the register buffer. If = 1, the value is written to the register buffer only. The addresses of the timer registers are as follows:
TMRB0 TB0RG0H/L Upper 8 bits (TB0RG0H) 1189H Lower 8 bits (TB0RG0L) 1188H TB0RG1H/L Upper 8 bits (TB0RG1H) 118BH Lower 8 bits (TB0RG1L) 118AH
Note: The timer registers are write-only registers and thus cannot be read.
92C820-307
2007-02-16
TMP92C820
(4) Capture registers (TB0CP0H/L, TB0CP1H/L) These 16-bit registers are used to latch the values in the up counters. All 16 bits of data in the capture registers should be read both Upper and Lower. For example, using a 2-byte data load instruction or two 1-byte data load instructions. The least significant byte is read first, followed by the most significant byte. The addresses of the capture registers are as follows:
TMRB0 TB0CP0H/L Upper 8 bits (TB0CP0H) 118DH Lower 8 bits (TB0CP0L) 118CH TB0CP1H/L Upper 8 bits (TB0CP1H) 118FH Lower 8 bits (TB0CP1L) 118EH
Note: The capture registers are read-only registers and thus cannot be written to.
(5) Capture input control This circuit controls the timing to latch the value of the up counter UC10 into TB0CP0H/L, TB0CP1H/L. The value in the up counter can be loaded into a capture register by software. Whenever 0 is written to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0H/L. It is necessary to keep the prescaler in Run Mode (i.e., TB0RUN must be held at a value of 1). Note: As described above, whenever 0 is programmed to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0H/L. However, note that the current value in the up counter is also loaded into capture register TB0CP0H/L when 1 is programmed to TB0MOD while this bit is holding
Notice Write to TBnMOD register TBnMOD
Capture operation Capture Capture Capture NOP
"0" WR
"0" WR
"1" WR
"1" WR
0. (6) Comparators (CP10 and CP11) CP10 and CP11 are 16-bit comparators which compare the value in the up counter UC10 with the value set in TB0RG0 or TB0RG1 respectively, in order to detect a match. If a match is detected, the comparator generates an interrupt (INTTB00 or INTTB01 respectively). (7) Timer flip-flops (TB0FF0) These flip-flops are inverted by the match detect signals from the comparators and the latch signals to the capture registers. Inversion can be enabled and disabled for each element using TB0FFCR. After a reset the value of TB0FF0 is undefined. If "00" is written to TB0FFCR, TB0FF0 will be inverted. If "01" is written to the capture registers, the value of TB0FF0 will be set to "1". If "10" is written to the capture registers, the value of TB0FF0 will be cleared to "0". The values of TB0FF0 can be output via the timer output pin TB0OUT0 (which is shared with PC6). Timer output should be specified using the port C function register.
92C820-308
2007-02-16
TMP92C820 3.17.3 SFRs
TMRB0 Run Register 7
TB0RUN (1180H) Bit symbol Read/Write After reset Function TB0RDE R/W 0 Double buffer 0: Disable 1: Enable
6
- R/W 0 Always write "0".
5
4
3
I2TB0 R/W 0 IDLE2 0: Stop 1: Operate
2
TB0PRUN
1
0
TB0RUN R/W 0 Up counter (UC10)
R/W 0 TMRB0 Prescaler 0: Stop and clear 1: Run (Count up)
Count operation 0 Stop and clear 1 Note: 1, 4, and 5 of TB0RUN are read as undefined values. Count
Figure 3.17.2 The Registers for TMRB
92C820-309
2007-02-16
TMP92C820
TMRB0 Mode Register 7
TB0MOD (1182H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 Always write "0". - R/W 0
6
-
5
TB0CP0I W* 1
Execute software capture 0: Software
4
TB0CPM1 0 Capture timing 00: Disable
3
TB0CPM0 0
2
TB0CLE R/W 0
1
TB0CLK1 0 00: Reserved 01: T1 10: T4 11: T16
0
TB0CLK0 0
capture
1: Undefined
Control up counter 0: Disable 01: Reserved clearing 10: Reserved 1: Enable 11: TA1OUT TA1OUT clearing
TMRB0 source clock
TMRB0 source clock 00 Reserved 01 10 11 T1 T4 T16
Up counter (UC10) clear control 0 Disable 1 Enable clearing on match with TB0RG1H/L.
Capture/interrupt timing Capture control 00 01 10 11 Disable
Reserved Reserved Capture to TB0CP0H/L at rising edge of TA1OUT Capture to TB0CP1H/L at falling edge of TA1OUT
Software capture 0 The value in the up counter is captured to TB0CP0H/L. 1 Undefined (Note)
Note: Whenever programming "0" to TB0MOD bit, present value of up counter is received to capture register TB0CP0H/L. But, program "1" to TB0MOD in condition of programmed "0" to TB0MOD bit, present value of up counter is received to capture register TB0CP0H/L. Therefore you must to regard.
Figure 3.17.3 The Registers for TMRB
92C820-310
2007-02-16
TMP92C820
TMRB0 Flip-Flop Control Register 7
TB0FFCR (1183H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 1 Always write "11". - W 1 0 0
6
-
5
TB0C1T1
4
TB0C0T1 R/W
3
TB0E1T1 0
2
TB0E0T1 0
1
TB0FFC1 W* 1 Control TB0FF0 00: Invert 01: Set
0
TB0FFC0 1
TB0FF0 inversion trigger 0: Disable trigger 1: Enable trigger
Invert when the UC10 value is loaded into TB0CP1H/L. Invert when the UC10 value is loaded into TB0CP0H/L. Invert when the UC10 value matches the value in TB0RG1H/L.
Invert when 10: Clear the UC10 11: Don't care value matches * Always read as 11. the value in TB0RG0H/L.
Timer flip-flop control (TB0FF0) 00 01 10 11 Invert Set to 1 Clear to 0 Don't care
Inverted when the UC10 value matches the value in TB0RG0H/L. 0 1 Disable trigger Enable trigger
Inverted when the UC10 value matches the value in TB0RG1H/L. 0 1 Disable trigger Enable trigger
Inverted when the UC10 value is loaded in to TB0CP0H/L. 0 1 Disable trigger Enable trigger
Inverted when the UC10 value is loaded in to TB0CP1H/L. 0 1 Disable trigger Enable trigger
Figure 3.17.4 The Registers for TMRB
92C820-311
2007-02-16
TMP92C820
TMRB0 Register 7
TB0RG0L (1188H) bit Symbol Read/Write After reset TB0RG0H (1189H) bit Symbol Read/Write After reset TB0RG1L (118AH) bit Symbol Read/Write After reset TB0RG1H (118BH) bit Symbol Read/Write After reset TB0CP0L (118CH) bit Symbol Read/Write After reset TB0CP0H bit Symbol (118DH) Read/Write After reset TB0CP1L (118EH) bit Symbol Read/Write After reset TB0CP1H bit Symbol (118FH) Read/Write After reset
6
5
4
- W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined
3
2
1
0
Note: All registers are prohibited to execute read-modify-write instruction.
Figure 3.17.5 The Registers for TMRB
92C820-312
2007-02-16
TMP92C820 3.17.4 Operation in Each Mode
(1) 16-bit timer mode Generating interrupts at fixed intervals In this example, the interrupt INTTB01 is set to be generated at fixed intervals. The interval time is set in the timer register TB0RG1H/L.
7 TB0RUN INTTB01 TB0FFCR TB0MOD TB0RG1 TB0RUN 0 1 0 * * 0 6 5 0 0 1 * * 4 3 2 1 0 1 * * * 0 Stop TMRB0. Enable INTTB01 and set interrupt level 4. Disable INTTB00. Disable the trigger. Select internal clock for input and disable the capture function. Set the interval time (16 bits). Start TMRB0. 0 1 * * *
0XX- 1 0 * * 0 0 * * 0 0 * *
0X0 0 1 * *
X 1
0X0
(** = 01, 10, 11)
0XX-
1X1
X: Don't care, -: No change
(2) 16-bit programmable pulse generation (PPG) output mode Square wave pulses can be generated at any frequency and duty ratio. The output pulse may be either low active or high active. The PPG mode is obtained by inversion of the timer flip-flop TB0FF0 that is enabled by the match of the up counter UC10 with timer register TB0RG0H/L or TB0RG1H/L and is output to TB0OUT0. In this mode the following conditions must be satisfied. (Value set in TB0RG0H/L) < (Value set in TB0RG1H/L)
Match with TB0RG0 (INTTB00 interrupt) Match with TB0RG1 (INTTB01 interrupt) TB0OUT0 pin
Figure 3.17.6 Programmable Pulse Generation (PPG) Output Waveforms When the TB0RG0 double buffer is enabled in this mode, the value of register buffer 0 will be shifted into TB0RG0 at match with TB0RG1. This feature facilitates the handling of low-duty waves.
Match with TB0RG0H/L Match with TB0RG1H/L Shift into TB0RG1H/L TB0RG0H/L (Value to be compared) Register buffer 0 Q1 Q2 Q2 Q3 Write TB0RG0H/L Up counter = Q1 Up counter = Q2
Figure 3.17.7 Operation of Register Buffer
92C820-313
2007-02-16
TMP92C820
The following block diagram illustrates this mode.
Selector TB0RUN TB0OUT0 (PPG output)
16-bit up counter UC10
T1 T4 T16
Clear
F/F (TB0FF0)
16-bit comparator
Match
16-bit comparator
Selector
TB0RG0H/L
TB0RG0H/L-WR
Register buffer 10
TB0RG1H/L
TB0RUN
Internal data bus
Figure 3.17.8 Block Diagram of 16-Bit Mode The following example shows how to set 16-bit PPG output mode:
7 TB0RUN TB0RG0H/L TB0RG1H/L TB0RUN 0 * * * * 1 6 * * * * 5 * * * * 4 * * * * 3 * * * * 2 * * * * 1 * * * * 0 Disable the TB0RG0H/L double buffer and stop TMRB0. Set the duty ratio (16 bits). Set the frequency (16 bits). Enable the TB0RG0H/L double buffer. (The duty and frequency are changed on an INTTB01 interrupt.) Set the mode to invert TB0FF0 at the match with TB0RG0H/L/TB0RG1H/L. Set TB0FF0 to 0. Select the Prescaler output clock as the input clock and disable the capture function. Set PC6 to function as TB0OUT0. Start TMRB0. * * * *
0XX-
0X0
0XX-
0X0
TB0FFCR TB0MOD PCCR PCFC TB0RUN
1 0
1 0
0 1
0 0
1 0
1 1
1 *
0 * - -
(** = 01, 10, 11) X 1 X 1 1 -X-X- -X-X-
0XX-
1X1
X: Don't care, -: No change
92C820-314
2007-02-16
TMP92C820
3.18 PSB (Power supply backup)
The power supply input of TMP92C820 is divided into three systems as follows; * * * Analog power supply input (AVCC to AVSS) Digital power supply input (DVCC to DVSS) Digital power supply input for RTC (RTCVCC to DVSS) The individual power supply input is isolated from each other.
AVCC TMP92C820 DVCC1 to DVCC3 RTCVCC
ADC control
CPU control and High OSC Other logic
RTC control
Low-OSC
AVSS
DVSS1 to DVSS4
BE
XT1
XT2
Figure 3.18.1 Power Supply Input System
DVCC Main power source for CPU and Other device TMP92C820
RTCVCC
RTC 32K_OSC
Sub battery for RTC
BE
DVSS
Figure 3.18.2 Outside Circuit Example for PSB
92C820-315
2007-02-16
TMP92C820
The TMP92C820 has the power supply backup mode which is designed to work for only RTC under sub battery supply. TMP92C820 enters the power supply backup mode using the BE (Backup enable signal pin) and the RESET . Figure 3.18.3 to Figure 3.18.4 show the timing diagram of BE and RESET .
0H 1H
10 s
BE
RESET
Power source (DVCC)
RTCVCC is always supplied.
Figure 3.18.3 Normal Mode to PSB Mode
Over 20 system clocks after oscillator becomes stable
BE
RESET
Power source (DVCC)
RTCVCC is always supplied.
Figure 3.18.4 Normal Mode from PSB Mode Backup enable pin ( BE ) RTC can work under BE = "L". It is prohibited to access to RTC registers when BE = "L". In addition, low-frequency oscillator (fs) isn't provided except RTC circuit. Under this condition, only internal RTC circuit operates, output function ( ALARM , INTRTC) is prohibited. Caution 1) Because it might waste power consumption if control signal is "H" level with no-power supply to DVcc, control signal usually set "L" level or high impedance. However, when using backup function with no-power supply to DVcc, BE pin must be input "L" level. 2) When BE pin is set to "L", low-frequency oscillator operates forcibly and RTC operates too. Therefore, don't set to BE = "L", when low-frequency oscillator and RTC are not operating. 3) When releasing RESET , please confirm BE pin to be "H" level completely before releasing RESET .
92C820-316
2007-02-16
TMP92C820
4.
4.1
Electrical Characteristics
Absolute Maximum Ratings
Parameter
Power supply voltage Input voltage Output current (Per pin) Output current (Per pin) Output current (Total) Output current (Total) Power dissipation (Ta = 85C) Soldering temperature (10 s) Storage temperature Operation temperature
Symbol
VCC VIN IOL IOH IOL IOH PD Tsolder Tstg Topr
Rating
-0.5 to 4.0 -0.5 to VCC + 0.5 2 -2 80 -80 600 260 -65 to +150 -20 to +70
Unit
V
mA
mW C
Note:
The absolute maximum ratings are rated values that must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any absolute maximum rating is exceeded, the device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products that include this device, ensure that no absolute maximum rating value will ever be exceeded.
Solderability of lead-free products
Test parameter Solderability (1) Use of Sn-37Pb solder Bath Solder bath temperature =230C, Dipping time = 5 seconds The number of times = one, Use of R-type flux (2) Use of Sn-3.0Ag-0.5Cu solder bath Solder bath temperature =245 C, Dipping time = 5 seconds The number of times = one, Use of R-type flux (use of lead-free) Pass: solderability rate until forming 95% Test condition Note
92C820-317
2007-02-16
TMP92C820
4.2
DC Electrical Characteristics
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C Parameter Symbol
VCC
Condition
X1 = 4 to 40 MHz (Internal 2 to 20 MHz) XT1 = 30 to 34 kHz
Min
3.0
Typ.
Max
3.6
Unit
V
Power supply voltage (DVCC = AVCC = RTCVCC) (DVSS = AVSS = 0 V) Input low voltage D0 to D7 P10 to P17 (D8 to D15) P20 to P27 (D16 to D23) P30 to P37 (D24 to D31) Input low voltage P40 to P47 P50 to P57 P60 to P67 P76 P95 PF0, PF3 PG0 to PG4 PL0 to PL7 Input low voltage P90 to P94, P96 PA0 to PA7 PC0, PC1, PC3, PC5, PC6 PF1, PF2, PF4, PF5
BE
VIL0
0.6
VIL1
0.3VCC
-0.3
V
VIL2
0.25VCC
RESET
Input low voltage AM0 to AM1 Input low voltage X1, XT1 Input high voltage D0 to D 7 P10 to P17 (D8 to D15) P20 to P27 (D16 to D23) P30 to P37 (D24 to D31) Input high voltage P40 to P47 P50 to P57 P60 to P67 P76 P95 PF0, PF3 PG0 to PG4 PL0 to PL7 Input high voltage P90 to P94, P96 PA0 to PA7 PC0, PC1, PC3, PC5, PC6 PF1, PF2, PF4, PF5
BE RESET
VIL3 VIL4
0.3 0.2VCC
VIH0
2.0
VIH1
0.7 x VCC
VCC + 0.3
V
VIH2
0.75 x VCC
Input high voltage AM0 to AM1 Input high voltage X1, XT1
VIH3
VCC - 0.3 0.8 x VCC
VIH4
92C820-318
2007-02-16
TMP92C820
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C Parameter
Output low voltage Output high voltage Input leakage current Output leakage current Power down voltage at STOP (for internal RAM backup) Pull-up resistor RESET Programmable pull-up resistor Pin capacitance Schmitt width Operating current (NORMAL) IDLE2 mode IDLE1 mode STOP SLOW SLOW, IDEL2 mode SLOW, IDLE1 mode RTC VCC power dissipation
Symbol
VOL VOH ILI ILO VSTOP RRST
Condition
IOL = 1.6 mA IOH = -400 A 0.0 Vin VCC 0.2 Vin VCC - 0.2 VIL2 = 0.2 VCC, VIH2 = 0.8 VCC
Min
2.4
Typ.
Max
0.45
Unit
V V A A V
0.02 0.05 1.8
5 10 3.6
100 RKH CIO VTH ICC ICCIDLE2 ICCIDLE1 ICCSTOP ICCS ICCSIDLE2 ICCSIDLE1 ICCRTC RTCVCC = 3.6 V, XT1 = 32.768 kHz RTCVCC = 2.0 V, XT1 = 32.768 kHz DVCC = 3.6 V DVCC = 3.6 V, XT1 = 32.768 kHz (Internal 15.8625 kHz) fc = 1 MHz P90 to P94, P96, PA0 to PA7, PC0, PC1, PC3, PC5, PC6, PF1, PF2, PF4, PF5, BE , RESET DVCC = 3.6 V, X1 = 40 MHz (Internal 20 MHz) 0.4 1.0 37.0 26.0 2.7 0.4 43.0 30.0 8.0 4.0 1.0
400
k
10
pF V
60 39 5.0 15 100 70 40 7.0 2.0
mA mA mA A A A A A
92C820-319
2007-02-16
TMP92C820
4.3
AC Characteristics
Basic Bus Cycle
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C Parameter
OSC period (X1/X2) System clock period (= T) SDCLK low width SDCLK low width A0 to A23 valid D0 to D31 input at 0 waits A0 to A23 valid D0 to D31 input at 1 wait
RD fall
4.3.1
Read cycle No.
1 2 3 4 5-1 5-2 6-1 6-2 7-1 7-2 8 9 10 11 12 13 14
Symbol
tOSC tCYC tCL tCH tAD tAD3 tRD tRD3 tRR tRR3 tAR tRK tHA tHR tTK tKT tSBA
Min
25 50 0.5T - 15 0.5T - 15
Max
250 500
at 20 MHz
25 50 10 10
at 16 MHz
31.25 62.5 16 16 95 157.5 63.75 126.25 74 136 11 11 0 0 15 5 63.75
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
2.0T - 30 3.0T - 30 1.5T - 30 2.5T - 30 1.5T - 20 2.5T - 20 0.5T - 20 0.5T - 20 0 0 15 5 1.5T - 30
70 120 45 95 55 105 5 5 0 0 15 5 45
D0 to D31 input at 0 waits
RD fall
D0 to D31 input at 1 wait
RD low width at 0 waits
RD low width at 1 wait
A0 to A23 valid RD fall RD rise SDCLK rise A0 to A23 valid D0 to D31 hold
RD rise D0 to D31 hold
WAIT setup time
WAIT hold time
Data byte control access time for SRAM
Write cycle No.
15-1 15-2 16-1 16-2 17 18 19 20 21 22 23 24 25 26 27
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C Parameter Symbol
tDW tDW3 tWW tWW3 tAW tWK tWA tWD tRDO tSWP tSAS tSWR tSDS tSDH
Min
1.25T - 35 2.25T - 35 1.25T - 30 2.25T - 30 0.5T - 20 0.5T - 20 0.25T - 5 0.25T - 5 0.5T - 5 1.25T - 30 1.25T - 30 0.5T - 20 0.25T - 5 1.25T - 35 0.25T - 5
Max
at 20 MHz
28 78 33 83 5 5 8 8 20 32.5 32.5 5 7.5 27.5 7.5
at 16 MHz
43 106 48 111 11 11 11 11 26.25 48.125 48.125 11.25 10.625 43.125 10.625
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
D0 to D31 valid WRxx rise at 0 waits D0 to D31 valid WRxx rise at 1 wait
WRxx low width at 0 waits WRxx low width at 1 wait
A0 to A23 valid WR fall
WRxx fall SDCLK rise WRxx rise A0 to A23 hold WRxx rise D0 to D31 hold RD rise D0 to D31 output
Write pulse width for SRAM Address setup time for SRAM Write recovery time for SRAM Data setup time for SRAM Data hold time for SRAM
Data byte control to end of write for SRAM tSBW
AC condition * Output: High = 0.7 VCC, Low = 0.3 VCC, CL = 50 pF * Input: High = 0.9 VCC, Low = 0.1 VCC
92C820-320
2007-02-16
TMP92C820
(1) Read cycle (0 waits)
tOSC X1 tCYC tCH SDCLK
tTK
WAIT
A0 to A23
tAD
CSx
tAR
RD
tRK
tHA tHR tRR tRD
D0 to D31
Data-in
tSBA
SRxB
SRWR
Note:
The phase relation between X1 input signal and the other signals is unsettled. The timing chart above is an example.
92C820-321
2007-02-16
TMP92C820
(2) Write cycle (0 waits)
tOSC X1 tCYC tCH SDCLK tTK
WAIT
tCL
tKT
A0 to A23
CSx
WRxx
tAW
tWK
tWA
tWW tDW D0 to D31
RD
tSWR tWD Data-out
tRDO
tSBW
SRxB
tSDH
tSAS
SRWR
tSDS tSWP
Note:
The phase relation between X1 input signal and the other signals is unsettled. The timing chart above is an example.
92C820-322
2007-02-16
TMP92C820
(3) Read cycle (1 wait)
SDCLK
WAIT
A0 to A23 tAD3
CSx
RD
tRR3 tRD3 Data-in
D0 to D31
(4) Write cycle (1 wait)
SDCLK
WAIT
A0 to A23
CSx
WRxx
tWW3 tDW3 D0 to D31
RD
tRD0
Data-out
92C820-323
2007-02-16
TMP92C820 4.3.2 Page ROM Read Cycle
(1) 3-2-2-2 mode VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C No.
1 2 3 4 5 6
Parameter
System clock period (= T) A0 and A1 D0 to D31 input A2 to A23 D0 to D31 input RD fall D0 to D31 input A0 to A23 invalid D0 to D31 hold RD rise D0 to D31 hold
Symbol
tCYC tAD2 tAD3 tRD3 tHA tHR
Min
50
Max
500 2.0T - 50 3.0T - 50 2.5T - 45
at 20 MHz
50 50 100 80 0 0
at 16 MHz
62.5 75 138 111 0 0
Unit
ns ns ns ns ns ns
0 0
AC condition * Output: High = 0.7VCC, Low = 0.3VCC, CL = 50 pF * Input: High = 0.9VCC, Low = 0.1VCC (2) Page ROM read cycle (3-2-2-2 mode)
SDCLK tCYC A0 to A23
CS2
+0
+1
+2
+3
tAD3
RD
tAD2
tAD2
tAD2
tHA
tRD3
Data-in
tHA
Data-in
tHA
Data-in
tRD3
Data-in
tHR
D0 to D31
92C820-324
2007-02-16
TMP92C820
4.4
SDRAM Controller AC Electrical Characteristics
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C
No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Parameter
Ref/active to Ref/active command period Active to precharge command period Active to read/write command delay time Precharge to active command period Active to active command period Write recovery time (CL* = 2) CLK cycle time (CL* = 2) CLK high level width CLK low level width Access time from CLK (CL* = 2) Output data hold time Data-in setup time Data-in hold time Address setup time Address hold time CKE setup time Command setup time Command hold time Mode register set cycle time
Symbol
tRC tRAS tRCD tRP tRRD tWR tCK tCH tCL tAC tOH tDS tDH tAS tAH tCKS tCMS tCMH tRSC 0
Variable Min
2T 2T T T 3T T T 0.5T - 15 0.5T - 15 T - 30
at 20 MHz Min
100 100 50 50 150 50 50 10 10 20 0 15 45 2.5 3 10 10 10 50
at 16 MHz Min
125 125 62.5 62.5 187.5 62.5 62.5 16.25 16.25 32.5 0 27.5 57.50 11.88 3 16.25 16.25 16.25 62.5
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Max
Max
Max
T - 35 T-5 0.75T - 35 3 0.5T - 15 0.5T - 15 0.5T - 15 T
Note 1: CL* is CAS latency. Note 2: AC measuring conditions * Output level: High = 0.7 VCC, Low = 0.3 VCC, CL = 50 pF * Input level: High = 0.9 VCC, Low = 0.1 VCC.
92C820-325
2007-02-16
TMP92C820
* SDRAM read timing (CPU access or LCDC normal access)
tCK SDCLK tCH SDxDQM tCMS
SDCS
tCL
tRP
tRCD
tRAS
tRP
tCMS
tCMH
tCMH
SDRAS
tRRD
SDCAS
SDWE
16-bit data bus A1 to A10
tAS Row
tAH Column tAS tAH Column
A11
Row
A12 to A15
Row
Column tAC tOH Data-in
D0 to D15
32-bit data bus A1 to A11
tAS Row
tAH Column tAS tAH Column
A12
Row
A13 to A15
Row
Column tAC tOH Data-in
D0 to D31
92C820-326
2007-02-16
TMP92C820
*
SDCLK tCH SDxDQM tCMS
SDCS
SDRAM write timing (CPU access)
tCK tRP tRCD tWR tRP
tCL
tCMS
tRRD
tCMH
SDRAS
tCMH
SDCAS
tRAS
SDWE
16-bit data bus A1 to A12
tAS Row
tAH Column tAS tAH Column
A11
Row
A12 to A15
Row tDS
Column tDH Data-out
D0 to D15
32-bit data bus A1 to A11
tAS Row
tAH Column tAS tAH Column
A12
Row
A13 to A15
Row tDS
Column tDH Data-out
D0 to D31
92C820-327
2007-02-16
TMP92C820
* SDRAM burst read timing (Start of burst cycle)
tCK SDCLK tCMS SDxDQM tRP
SDCS
tRCD tCM tCM tCM
tCMS
SDRAS
SDCAS
tCM
SDWE
tAS A1 to A11 or A1 to A10 A12 or A11
tAH
tAS Row
tAH
tAS Column
227
Row
Column
A13 to A15 or A12 to A15 D0 to D31
0
Row tAC tAC Data-in tOH Data-in tOH tAC Data-in
92C820-328
2007-02-16
TMP92C820
* SDRAM burst read timing (End of burst cycle)
tCK SDCLK tCMS SDxDQM tCM tCMS
SDCS
tRSC
tRC
tCM
SDRAS
tCMS
SDCAS
tCM
SDWE
tAS A1 to A11 or A1 to A10 A12 or A11 Column 220 Column
Column
Column
A13 to A15 or A12 to A15 D0 to D31
Row tAC Data-in tOH tAC Data-in tOH
0
Column
Data-in tOH
92C820-329
2007-02-16
TMP92C820
*
SDCLK tCH SDxDQM tCMS
SDCS
SDRAM initialize timing
tCK tCL
tRSC
tRC
tCM
SDRAS
tCMS
SDCAS
tCM
tCM
tCM
SDWE
tAS A1 to A12
tAH
tAS 220
A20 to A23 (BS0 and BS1)
92C820-330
2007-02-16
TMP92C820
* SDRAM refresh timing
tCK SDCLK tRC SDxDQM tCMS
SDCS SDRAS SDCAS SDWE
tRC
tCM
*
SDRAM self refresh timing
tCK
SDCLK tCKS SDCKE SDxDQM tCMS
SDCS SDRAS SDCAS SDWE
tCKS
tRC
tCM
92C820-331
2007-02-16
TMP92C820
4.5
AD Conversion Characteristics
Parameter
Analog reference voltage (+) Analog reference voltage (-) AD converter power supply voltage AD converter ground Analog input voltage Analog current for analog reference voltage Analog current for analog reference voltage Total error (Quantize error of 0.5 LSB is included) = 1
Symbol
VREFH VREFL AVCC AVSS AVIN IREF
Min
VCC - 0.2 VSS VCC VSS VREFL
Typ.
VCC VSS VCC VSS
Max
VCC VSS + 0.2 VCC VSS VREFH
Unit
V
0.8
1.2
mA
= 0
0.02 1.0
5.0 4.0
UA
ET
LSB
4.6
Event Counter (TI0, TI4, TI8, TI9, TIA, and TIB)
Parameter
Symbol
TVCK TVCKL TVCKH
Variable Min Max
8T + 100 4T + 40 4T + 40
20 MHz Min
500 240 240
16 MHz Min
600 290 290
Unit
ns ns ns
Max
Max
Clock cycle Clock low width Clock high width
92C820-332
2007-02-16
TMP92C820
4.7
Serial Channel Timing
(1) SCLK input mode (I/O interface mode) Parameter
Symbol
Variable Min Max
16T TSCY/2 - 4T - 110 TSCY/2 + 2T +0 0 TSCY - 0 0
20 MHz Min
0.8 90 500 0 800 0
16 MHz Min
1.0 140 625
Unit
s
Max
Max
SCLK cycle Output data SCLK rise SCLK rise Output data hold SCLK rise Input data hold SCLK rise Input data valid Input data SCLK rise
TSCY TOSS TOHS THSR TSRD TRDS
ns 0 1000
(2) SCLK output mode (I/O interface mode) Parameter
SCLK cycle (Programmable) Output data SCLK rise SCLK rise Output data hold SCLK rise Input data hold SCLK rise Input data valid Input data SCLK rise
Symbol
Variable Min Max
8192T 16T TSCY/2 - 40 TSCY/2 - 40 0 TSCY - 1T - 180 0
20 MHz Min
0.8 360 360 0 570 0
16 MHz Min
1.0 460 460 0 757.5 0
Unit
s
Max
409.6
Max
512
TSCY TOSS TOHS THSR TSRD TRDS
ns
tSCY SCLK Output mode/ Input rising mode SCLK (Input falling mode) tOSS Output data TXD 0 tSRD Input data RXD 0 Valid tRDS tHSR 1 Valid 2 Valid 3 Valid tOHS 1 2 3
92C820-333
2007-02-16
TMP92C820
4.8
Interrupt Operation
Parameter Symbol
TINTAL TINTAH
Variable Min Max
4T + 40 4T + 40
20 MHz Min
200 200
16 MHz Min
290 290
Unit
ns
Max
Max
INT0 to INT3 low width INT0 to INT3 high width
4.9
LCD Controller SR Mode
tCW tCWH tCWL D1BSCP
tDSU LD0 to LD7
tDHD
LD0 to LD7 out
VCC = 3.3 0.3 V/X1 = 4 to 40 MHz/Ta = -20 to 70C Variable
Symbol
20 MHz (tm = 0) Max Min
5 20 15 15 50
16 MHz (tm = 0) Min
11.25 26.25 21.25 21.25 62.5
No.
Parameter
Unit
Min
1 2 3 4 5 Data vaild D1BSCP fall D1BSCP fall Data hold D1SBCP Clock high width D1BSCP Clock low width D1BSCP Clock cycle tDSU tDHD tCWH tCWL tCW 0.5T - 20 + tm 0.5T - 5 + tm 0.5T - 10 + tm 0.5T - 10 + tm T + 2tm
Max
Max
ns ns ns ns ns
Note: tm = (2scpw - 1) x, e.g., if Scpw = 3 (8 clock mode) and 20 MHz, tm = (23 - 1) x 50 = 350
92C820-334
2007-02-16
TMP92C820
4.10 Recommended Oscillation Circuit
The TMP92C820 has been evaluate by below the oscillator vender below. Use this information when selecting external parts. Note: The total load value of the oscillation is the sum of external loads (C1 and C2) and the floating load of the actual assembled board. There is a possibility of operating error when using C1 and C2 values in the table below. When designing the board, design the minimum length pattern around the oscillator. We also recommend that oscillator evaluation be carried out using the actual board.
(1) Connection example
X1
X2 Rd
XT1
XT2 Rd
C1
C2
C1
C2
Figure 4.10.1 High-frequency Oscillator
Figure 4.10.2 Low-frequency Oscillator
(2) TMP92C820 recommended ceramic oscillator: Murata Manufacturing Co., Ltd; JAPAN
Parameter of Elements Type Oscillator Product number C1 [pF] Note1 (47) (39) (47) (39) (47) (10) (15) (15) (10) (15) C2 [pF] Note1 (47) (39) (47) (39) (47) (10) (15) (15) (10) (15) Rf [] Open Open Open Open Open Open Open Open Open Open Rd [] 0 0 0 0 0 0 0 0 0 0 1.8~2.7 2.7~3.6 2.7~3.6 -20~ +80 Running Condition Voltage [V] 1.8~2.7 Tc [C]
Oscillation MCU Frequency [MHz] 2.000 4.000 6.000 TMP92C820FG 10.000 12.000 20.000 SMD SMD Lead SMD Lead SMD Lead SMD SMD CSTCC2M00G56-R0 CSTCR4M00G55-R0 CSTLS4M00G56-B0 CSTCR6M00G55-R0 CSTLS6M00G56-B0 CSTCE10M0G52-R0 CSTLS10M0G53-B0 CSTLS10M0G53-B0 CSTCE12M5G52-R0 CSTCG20M0V53-R0
Note 1: Note 2:
The figure in parentheses ( ) under C1 and C2 is the built-in condenser type. The product numbers and specifications of the osillators made by Murata Manufacturing Co., Ltd. are subject to change. For up-to-date information, please refer to the following URL: http://www.murata.co.jp/
92C820-335
2007-02-16
TMP92C820
5.
Table of Special Function Registers (SFRs)
The SFRs (Special function registers) include the I/O ports and peripheral control registers allocated to the 8-Kbyte address space from 000000H to 001FFFH. (1) I/O port (2) I/O port control (3) Interrupt control (4) DMA controller (5) Memory controller (6) MMU (7) Clock gear (8) LCD controller (9) SDRAM controller (10) 8-bit timer (11) 16-bit timer (12) UART/serial channel (13) I2C bus/serial channel (14) AD converter (15) Watchdog timer (16) RTC (Real time clock) (17) Melody/alarm generator
Table layout Symbol Name Address 7 6 1 0 Bit symbol Read/Write Initial value after reset Remarks Note: "Prohibit RMW" in the table means that you cannot use RMW instructions on these registers. Example) When setting bit0 only of the register P0CR, the instruction "SET 0, (PxCR)" cannot be used. The LD (Transfer) instruction must be used to write all eight bits.
Read/Write R/W: Both read and write are possible. R: W: W*: Only read is possible. Only write is possible. Both read and write are possible (when this bit is read as 1).
Prohibit RMW: Read-modify-write instructions are prohibited. (EX, ADD, ADC, BUS, SBC, INC, DEC,AND, OR, XOR, STCF, RES, SET, CHG, TSET, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD instructions are read-modify-write instructions.) Prohibit RMW *: Read-modify-write is prohibited when controlling the pull-up resistor.
92C820-336
2007-02-16
TMP92C820
Table 5.1 I/O Register Address Map [1] Port
Address 0000H 1H 2H 3H 4H P1 5H 6H P1CR 7H P1FC 8H P2 9H AH P2CR BH P2FC CH P3 DH EH P3CR FH P3FC Address 0040H PG 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH PJ DH PJFC2 EH FH PJFC Name Name Address 0010H P4 1H 2H P4CR 3H P4FC 4H P5 5H 6H P5CR 7H P5FC 8H P6 9H AH P6CR BH P6FC CH P7 DH EH P7CR FH P7FC Address 0050H PK 1H 2H 3H PKFC 4H PL 5H 6H PLCR 7H PLFC 8H 9H AH BH CH DH EH FH Name Name Address 0020H P8 1H P8FC2 2H 3H P8FC 4H P9 5H P9ODE 6H P9CR 7H P9FC 8H PA 9H AH BH PAFC CH DH EH FH Name Address 0030H PC 1H 2H PCCR 3H PCFC 4H 5H 6H 7H 8H 9H AH BH CH PF DH EH PFCR FH PFFC Name
Note: Do not access un-named addresses.
92C820-337
2007-02-16
TMP92C820
[2] INTC
Address Name Address Name Address Name 00D0H INTE12 1H INTE3 2H 3H 4H INTETA01 5H INTETA23 6H 7H 8H INTETB01 9H AH INTETBO0 BH INTES0 CH INTES1 DH EH FH 00E0H Reserved 1H Reserved 2H Reserved 3H INTESB0 4H Reserved 5H INTALM01 6H INTALM23 7H INTALM4 8H INTERTC 9H INTEKEY AH INTLCD BH Reserved CH Reserved DH INTES2 EH INTEP0 FH 00F0H INTE0AD 1H INTETC01 2H INTETC23 3H INTETC45 4H INTETC67 5H SIMC 6H IIMC 7H INTWDT 8H INTCLR 9H AH BH CH DH EH FH
[3] DMAC
Address Name 0100H DMA0V 1H DMA1V 2H DMA2V 3H DMA3V 4H DMA4V 5H DMA5V 6H DMA6V 7H DMA7V 8H DMAB 9H DMAR AH Reserved BH CH DH EH FH
[4] MEMC
Address Name Address 0150H 1H 2H 3H 4H 5H 6H 7H 8H BEXCSL 9H BEXCSH AH BH CH DH EH FH Name Address 0160H 1H 2H 3H 4H 5H 6H PMEMCR 7H 8H 9H AH BH CH DH EH FH Name 0140H B0CSL 1H B0CSH 2H MAMR0 3H MSAR0 4H B1CSL 5H B1CSH 6H MAMR1 7H MSAR1 8H B2CSL 9H B2CSH AH MAMR2 BH MSAR2 CH B3CSL DH B3CSH EH MAMR3 FH MSAR3
[5] MMU
Address Name 01D0H LOCAL0 1H LOCAL1 2H LOCAL2 3H LOCAL3 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Note: Do not access un-named addresses.
92C820-338
2007-02-16
TMP92C820
[6] CGEAR
Address Name 10E0H SYSCR0 1H SYSCR1 2H SYSCR2 3H EMCCR0 4H EMCCR1 5H EMCCR2 6H Reserved 7H 8H Reserved 9H Reserved AH BH CH DH EH FH
[7] LCDC-1
Address Name Address Name 0200H LCDMODE 1H LCDDVM 2H LCDSIZE 3H LCDCTL 4H LCDFFP 5H LCDGL 6H LCDCM 7H LCDCW 8H LCDCH 9H LCDCP AH LCDCPL BH LCDCPM CH LCDCPH DH Reserved EH FH 0210H LSARAM 1H LSARAH 2H LEARAM 3H LEARAH 4H LSARBM 5H LSARBH 6H LEARBM 7H LEARBH 8H LSARCL 9H LSARCM AH LSARCH BH CH DH EH FH
[7] LCDC-2
Address Name Address Name Address 0240H 1H 2H 3H 4H 5H 6H 7H 8H Reserved 9H Reserved AH Reserved BH Reserved CH Reserved DH Reserved EH Reserved FH Reserved Name 0220H LG0L 1H LG0H 2H LG1L 3H LG1H 4H LG2L 5H LG2H 6H LG3L 7H LG3H 8H LG4L 9H LG4H AH LG5L BH LG5H CH LG6L DH LG6H EH LG7L FH LG7H 0230H LG8L 1H LG8H 2H LG9L 3H LG9H 4H LGAL 5H LGAH 6H LGBL 7H LGBH 8H LGCL 9H LGCH AH LGDL BH LGDH CH LGEL DH LGEH EH LGFL FH LGFH
Note: Do not access un-named addresses.
92C820-339
2007-02-16
TMP92C820
[8] SDRAMC
Address Name 0250H SDACR 1H SDRCR 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[9] 8-bit timer
Address 1H 2H TA0REG 3H TA1REG 4H TA01MOD 5H TA01FFCR 6H 7H 8H TA23RUN 9H AH TA2REG BH TA3REG CH TA23MOD DH TA3FFCR EH FH Name 1100H TA01RUN
[10] 16-bit timer
Address Name 1180H TB0RUN 1H 2H TB0MOD 3H TB0FFCR 4H 5H 6H 7H 8H TB0RG0L 9H TB0RG0H AH TB0RG1L BH TB0RG1H CH TB0CP0L DH TB0CP0H EH TB0CP1L FH TB0CP1H
[11] SIO
Address Name Address Name 1200H SC0BUF 1H SC0CR 2H SC0MOD0 3H BR0CR 4H BR0ADD 5H SC0MOD1 6H 7H SIRCR 8H SC1BUF 9H SC1CR AH SC1MOD0 BH BR1CR CH BR1ADD DH SC1MOD1 EH FH 1210H SC2BUF 1H SC2CR 2H SC2MOD0 3H BR2CR 4H BR2ADD 5H SC2MOD1 6H 7H 8H 9H AH BH CH DH EH FH
[12] SBI
Address Name 1240H SBI0CR1 1H SBI0DBR 2H I2C0AR 3H SBI0CR2/SBI0SR 4H SBI0BR0 5H SBI0BR1 6H 7H 8H 9H AH BH CH DH EH FH
Note: Do not access un-named addresses.
92C820-340
2007-02-16
TMP92C820
[13] 10-bit ADC
Address Name Address 12B0H 1H 2H 3H 4H 5H 6H 7H 8H ADMOD0 9H ADMOD1 AH ADMOD2 BH Reserved CH DH EH FH Name 12A0H ADREG0L 1H ADREG0H 2H ADREG1L 3H ADREG1H 4H ADREG2L 5H ADREG2H 6H ADREG3L 7H ADREG3H 8H ADREG4L 9H ADREG4H AH Reserved BH Reserved CH Reserved DH Reserved EH Reserved FH Reserved
[14] WDT
Address Name 1300H WDMOD 1H WDCR 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[15] RTC
Address Name 1320H SECR 1H MINR 2H HOURR 3H DAYR 4H DATER 5H MONTHR 6H YEARR 7H PAGER 8H RESTR 9H AH BH CH DH EH FH
[16] MLD
Address Name 1330H ALM 1H MELALMC 2H MELFL 3H MELFH 4H ALMINT 5H 6H 7H 8H 9H AH BH CH DH EH FH
Note: Do not access un-named addresses.
92C820-341
2007-02-16
TMP92C820
(1) I/O port Symbol
P1
Name
Port 1
Address
0004H
7
P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Data from external port (Output latch register is cleared to 0) P27 P2 Port 2 0008H P37 P3 Port 3 000CH P47 P4 Port 4 0010H P57 P5 Port 5 0014H P67 P6 Port 6 0018H P66 P65 P64 R/W Data from external port (Output latch register is cleared to 0) - P76 P7 Port 7 001CH Data from external port Note1 P87 P8 Port 8 0020H 1 P9 Port 9 0024H PA7 PA Port A 0028H PC6 R/W PC Port C 0030H Data from external port Note2 PF5 PF Port F 003CH PG4 PG Port G 0040H PJ7 PJ Port J 004CH 1 PK Port K 0050H PL7 PL Port L 0054H 1 PK6 R/W 1 PL6 PL5 1 PL4 R/W Data from external port (Output latch register is set to 1) Note 1: Output latch register is cleared to 0. Note 2: Output latch register is set to 1 1 PL3 1 1 PK4 PJ6 PJ5 PJ4 R/W 1 PK3 1 PK2 R/W 1 PL2 1 PL1 1 PL0 1 PK1 1 PK0 PJ3 PG3 PF4 PC5 PA6 PA5 PA4 R Data from external port PC3 R/W Data from external port Note2 PF3 R/W Data from external port (Output latch register is set to 1) PG2 R Data from external port PJ2 PJ1 PJ0 PG1 PG0 PF2 PC1 R/W Data from external port Note2 PF1 PF0 PC0 1 P96 1 P95 1 P94 P86 P75 P74 P73 R/W 1 P85 1 P84 R/W 1 P93 R/W Data from external port (Output latch register is set to 1) PA3 PA2 PA1 PA0 0 P92 1 P91 1 P90 1 P83 1 P82 1 P81 1 P80 P72 P71 P70 P56 P55 P54 R/W Data from external port (Output latch register is cleared to 0) P63 P62 P61 P60 P46 P45 P44 R/W Data from external port (Output latch register is cleared to 0) P53 P52 P51 P50 P36 P35 P34 R/W Data from external port (Output latch register is cleared to 0) P43 P42 P41 P40 P26 P25 P24 R/W Data from external port (Output latch register is cleared to 0) P33 P32 P31 P30 P23 P22 P21 P20
92C820-342
2007-02-16
TMP92C820
(2) I/O port control (1/3) Symbol Name
Port 1 P1CR control register
Address
0006H (Prohibit RMW) 0007H (Prohibit RMW) 000AH (Prohibit RMW) 000BH (Prohibit RMW) 000EH (Prohibit RMW) 000FH (Prohibit RMW) 0012H (Prohibit RMW) 0013H (Prohibit RMW) 0016H (Prohibit RMW) 0017H (Prohibit RMW) 001AH (Prohibit RMW) 001BH (Prohibit RMW)
7
P17C 0
6
P16C 0
5
P15C 0
4
P14C W 0
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0 P1F
0: Input 1: Output W 1
0: Port 1:Data bus (D8 to D15)
Port 1 P1FC function register
Port 2 P2CR control register
P27C 0
P26C 0
P25C 0
P24C W 0
P23C 0
P22C 0
P21C 0
P20C 0 P2F
0: Input 1: Output W 0/1
0: Port 1: Data bus (D16 to D23)
Port 2 P2FC function register
Port 3 P3CR control register
P37C 0
P36C 0
P35C 0
P34C W 0
P33C 0
P32C 0
P31C 0
P30C 0 P3F
0: Input 1: Output W 0/1
0: Port 1: Data bus (D24 to D31)
Port 3 P3FC function register
Port 4 P4CR control register
P47C 0 P47F 1 P57C 0 P57F 1 P67C 0 P67F 1
P46C 0 P46F 1 P56C 0 P56F 1 P66C 0 P66F 1
P45C 0 P45F 1 0: Port P55C 0 P55F 1 0: Port P65C 0 P65F 1 0: Port
P44C W 0 P44F W 1 P54C W 0 P54F W 1 P64C W 0 P64F 1
P43C 0 P43F 1 P53C 0 P53F 1 P63C 0 P63F W 1
P42C 0 P42F 1 P52C 0 P52F 1 P62C 0 P62F 1
P41C 0 P41F 1 P51C 0 P51F 1 P61C 0 P61F 1
P40C 0 P40F 1 P50C 0 P50F 1 P60C 0 P60F 1
0: Input 1: Output
Port 4 P4FC function register
1: Address bus (A0 to A7)
Port 5 P5CR control register
0: Input 1: Output
Port 5 P5FC function register
1: Address bus (A8 to A15)
Port 6 P6CR control register
0: Input 1: Output
Port 6 P6FC function register
1: Address bus (A16 to A23)
92C820-343
2007-02-16
TMP92C820
I/O port control (2/3) Symbol Name
Port 7 P7CR control register
Address
001EH (Prohibit RMW)
7
6
P76C W 0 0: Input 1: Output P76F 0 0: Port 1: WAIT
5
4
3
2
1
0
Port 7 P7FC function register
001FH (Prohibit RMW) P87F
P75F 0 0: Port 1: R/W P85F 0 0: Port 1: EA25 P85F2
P74F 0 0: Port 1: WRUU P84F W 0 0: Port 1: EA24 P84F2 W
P73F W 0 0: Port 1: WRUL P83F 0 0: Port 1: CS3 -
P72F 0 0: Port 1: WRLU P82F 0 0: Port 1: CS2 P82F2
P71F 0 0: Port 1: WRLL P81F 0 0: Port 1: CS1 P81F2
P70F 1 0: Port 1: RD P80F 0 0: Port 1: CS0 P80F2
Port 8 P8FC function register
0023H
- 0 Always write 0. P86F2
1 (Prohibit RMW) 0: Port 1: SDCLK 0021H (Prohibit RMW) 0026H (Prohibit RMW) - 0 Always write "0"
Port 8 P8FC2 function register 2
0 0 0 0 0: 0: 0: Always 1: CS2C 1: CS2B 1: CS2D write "0". P96C 0 P96F P95C 0 P95F 0 0: Port 1: TXD2,
CS2G
0 0 0 0: 0: 0: 1: CS2A 1: SDCSL 1: SDCSH P92C 0 P92F P91C 0 P91F P90C 0 P90F
Port 9 P9CR control register
P94C 0 P94F 0 0: Port 1: CS2F
P93C W 0
0: Input 1: Output P93F W 0 0: Port 1: CS2E
Port 9 P9FC function register
0027H (Prohibit RMW)
0 0: Port 1: RXD2,
CSEXA
0 0 0 0: Port, 0: Port, SI 0: Port 1: SO, SDA SCK 1: SCL input Note 1: SCK output Note P92ODE 0
0: 3 states 1: Open drain
P95ODE Port 9 P9ODE ODE register 0025H 0 (Prohibit RMW) 002BH (Prohibit RMW) 0032H (Prohibit RMW) 0033H (Prohibit RMW) 0 PA7F 0 PA6F 0 PC6C W 0 0 0: Input 1: Output PC6F Port C PCFC function register W 0
0: Port 0: Port 1: INT3 1: INT2 TB0OUT0 TA3OUT 0: 3 states 1: Open drain
- 0 Always write "0" PA4F W 0
- W 0 Always write "0" PA3F 0 PC3C W 0 0: Input 1: Output PC3F W 1
0: Port 1: INT0
P91ODE 0
0: 3 states 1: Open drain
Port A PAFC function register
PA5F 0 PC5C
PA2F 0
PA1F 0 PC1C W 0
PA0F 0 PC0C 0
0: KEY-IN disable
1: KEY-IN enable
Port C PCCR control register
0: Input 1: Output PC1F W 0 0
0: Port 0: Port 1: INT1 1: TA0IN TA1OUT
PC5F
PC0F
Note : When using SI and SCK input function, set P9FC to "0" (Function setting).
92C820-344
2007-02-16
TMP92C820
I/O port control (3/3) Symbol Name
Port F PFCR control register
Address
003EH (Prohibit RMW) 003FH (Prohibit RMW)
7
6
5
PF5C 0 PF5F
4
PF4C 0
3
PF3C W 0 PF3F W 0 0: Port 1: TXD1
2
PF2C 0 PF2F 0 0: Port 1: SCLK0 output PJ2F
1
PF1C 0
0
PF0C 0 PF0F W 0 0: Port 1: TXD0
0: Input 1: Output W 0 0: Port 1: SCLK1 output PJ7F PJ6F PJ5F PJ4F W 0 0: Port 1: SDCAS - 0 Always write "0". PK1F 0 0: Port 1: D2BLP 0 0: Port 1: SDRAS - 0 Always write "0". PK0F 0 0: Port 1: D1BSCP
Port F PFFC function register
Port J PJFC function register
004FH
PJ3F
PJ1F
PJ0F
0 0 0 0 0 0 (Prohibit 0: Port 0: Port 0: Port 0: Port 0: Port RMW) 0: Port 1: SDCKE 1: SDUUDQM 1: SDULDQM 1: SDLUDQM 1: SDLLDQM 1: SDWE 004DH (Prohibit RMW) - 0 Always write "0". PF6F2 0 PF5F2 0 PF4F2 W 0 0 0 0: 0: 0: 0: 0: 1: SRWR 1: SRUUB 1: SRULB 1: SRLUB 1: SRLLB PK6F W 0053H (Prohibit RMW) 0
0: Port 1: ALARM at =1 1: MLDALM at =0
PF3F2
PF2F2
Port J PJFC2 function register 2
PK4F
PK3F
PK2F W
Port K PKFC function register
0 0 0 0: Port 0: Port 0: Port 1: DOFFB 1: DLEBCD 1: D3BFR
Port L PLCR control register
0056H (Prohibit RMW) 0057H (Prohibit RMW)
PL7C 0 PL7F 0
PL6C 0 PL6F 0
PL5C 0 PL5F 0
PL4C W 0 PL4F W 0
PL3C 0 PL3F 0
PL2C 0 PL2F 0
PL1C 0 PL1F 0
PL0C 0 PL0F 0
0: Input 1: Output
Port L PLFC function register
0: Port 1: Data bus for LCDC (LD7 to LD0)
92C820-345
2007-02-16
TMP92C820
(3) Interrupt control (1/3) Symbol Name
INT1& INT2 enable
Address
7
I2C R 0 1: INT2 - - -
6
INT2
I2M2
5
4
3
I1C R 0 1: INT1 I3C R 0 1: INT3 ITA0C R 0 1: INTTA0 ITA2C R 0 1: INTTA2 ITB0C R 0 1: INTTB0 ITBO0C R 0
2
INT1 I1M2
1
0
INTE12
00D0H
I2M1 I2M0 R/W 0 0 0 Level of request interrupt - - -
I1M1 I1M0 R/W 0 0 0 Level of request interrupt INT3 I3M1 I3M0 R/W 0 0 0 Level of request interrupt
INTE3
INT3 enable
00D1H
- - - - Always write "0".
-
I3M2
INTTA0& INTETA01 INTTA1 enable
00D4H
ITA1C R 0 1: INTTA1 ITA3C R 0 1: INTTA3 ITB1C R 0 1: INTTB1 - - -
INTTA1 (TMRA1) ITA1M2 ITA1M1 ITA1M0 R/W 0 0 0 Level of request interrupt INTTA3 (TMRA3) ITA3M2 ITA3M1 ITA3M0 R/W 0 0 0 Level of request interrupt INTTB1 (TMRB1) ITB1M2 ITB1M1 ITB1M0 R/W 0 0 0 Level of request interrupt - - - - - Always write "0". - - -
INTTA0 (TMRA0) ITA0M2 ITA0M1 ITA0M0 R/W 0 0 0 Level of request interrupt INTTA2 (TMRA2) ITA2M2 ITA2M1 ITA2M0 R/W 0 0 0 Level of request interrupt INTTB0 (TMRB0) ITB0M2 ITB0M1 ITB0M0 R/W 0 0 0 Level of request interrupt
INTTA2& INTETA23 INTTA3 enable
00D5H
INTTB0& INTETB01 INTTB1 enable
00D8H
INTTBO0 INTETBO0 (Overflow) enable
00DAH
INTTBO0 ITBO0M2 ITBO0M1 ITBO0M0 R/W 0 0 0 1: INTTBO0 Level of request interrupt IRX0C R 0 1: INTRX0 IRX1C R 0
1: INTRX1
INTES0
INTRX0& INTTX0 enable
00DBH
ITX0C R 0 1: INTTX0 ITX1C R 0
1: INTTX1
INTTX0 ITX0M2 ITX0M1 ITX0M0 R/W 0 0 0 Level of request interrupt INTTX1 ITX1M2 ITX1M1 ITX1M0 R/W 0 0 0 Level of request interrupt - - - - - Always write "0". - - -
INTRX0 IRX0M2 IRX0M1 IRX0M0 R/W 0 0 0 Level of request interrupt INTRX1 IRX1M2 IRX1M1 IRX1M0 R/W 0 0 0 Level of request interrupt
INTES1
INTRX1& INTTX1 enable
00DCH
INTESB0
INTSBE0 enable
00E3H
- - -
INTSBE0 ISBE0M2 ISBE0M1 ISBE0M0 R/W 0 0 0 1: INTSBE0 Level of request interrupt ISBE0C R 0 IA0C R 0
1: INTALM0
INTALM0 & INTEALM01 INTALM1 enable
00E5H
IA1C R 0
1: INTALM1
INTALM1 IA1M2 IA1M1 IA1M0 R/W 0 0 0 Level of request interrupt INTALM3 IA3M2 IA3M1 IA3M0 R/W 0 0 0 Level of request interrupt
INTALM0 IA0M2 IA0M1 IA0M0 R/W 0 0 0 Level of request interrupt INTALM2 IA2M2 IA2M1 IA2M0 R/W 0 0 0 Level of request interrupt
INTALM2 & INTEALM23 INTALM3 enable
00E6H
IA3C R 0
1: INTALM3
IA2C R 0
1: INTALM2
92C820-346
2007-02-16
TMP92C820
Interrupt control (2/3) Symbol Name
INTALM4 enable
Address
7
- - -
6
- -
5
4
- -
3
IA4C R 0 1: INTALM4
2
1
0
INTEALM4
00E7H
- - - - Always write "0". - - - - - Always write "0". - - - - - Always write "0". - - - - - Always write "0". - - -
INTALM4 IA4M2 IA4M1 IA4M0 R/W 0 0 0 Level of request interrupt INTRTC IRM2 IRM1 IRM0 R/W 0 0 0 Level of request interrupt INTKEY IKM2 IKM1 IKM0 R/W 0 0 0 Level of request interrupt INTLCD ILCDM2 ILCDM1 ILCDM0 R/W 0 0 0 Level of request interrupt INTRX2 IRX2M2 IRX2M1 IRX2M0 R/W 0 0 0 Level of request interrupt INTP0 IP0M2 IP0M1 IP0M0 R/W 0 0 0 Level of request interrupt
INTERTC
INTRTC enable
00E8H
- - -
- -
IRC R 0 1: INTRTC
INTECKEY
INTKEY enable
00E9H
- - -
- -
IKC R 0 1: INTKEY
INTLCD
INTLCD enable
00EAH
- - -
- -
ILCD1C R 0 1: INTLCD IRX2C R 0 1: INTRX2 IP0C R 0 1: INTP0
INTES2
INTRX2& INTTX2 enable
00EDH
ITX2C R 0 1: INTTX2 - - -
INTTX2 ITX2M2 ITX2M1 ITX2M0 R/W 0 0 0 Level of request interrupt - - - - - Always write "0". - - -
INTEP0
INTP0 enable
00EEH
92C820-347
2007-02-16
TMP92C820
Interrupt control (3/3) Symbol Name
INT0& INTAD enable
Address
7
IADC R 0 1: INTAD
6
5
4
3
I0C R 0 1: INT0 ITC0C R 0 1: INTTC0 ITC2C R 0 1: INTTC2 ITC4C R 0 1: INTTC4 ITC6C R 0 1: INTTC6
2
INT0 I0M2
1
0
INTE0AD
00F0H
INTAD IADM2 IADM1 IADM0 R/W 0 0 0 Level of request interrupt INTTC1 (DMA1) ITC1M2 ITC1M1 ITC1M0 R/W 0 0 0 Level of request interrupt INTTC3 (DMA3) ITC3M2 ITC3M1 ITC3M0 R/W 0 0 0 Level of request interrupt INTTC5 (DMA5) ITC5M2 ITC5M1 ITC5M0 R/W 0 0 0 Level of request interrupt INTTC7 (DMA7) ITC7M2 ITC7M1 ITC7M0 R/W 0 0 0 Level of request interrupt
I0M1 I0M0 R/W 0 0 0 Level of request interrupt
INTETC01
INTTC0& INTTC1 enable
00F1H
ITC1C R 0 1: INTTC1
INTTC0 (DMA0) ITC0M2 ITC0M1 ITC0M0 R/W 0 0 0 Level of request interrupt INTTC2 (DMA2) ITC2M2 ITC2M1 ITC2M0 R/W 0 0 0 Level of request interrupt INTTC4 (DMA4) ITC4M2 ITC4M1 ITC4M0 R/W 0 0 0 Level of request interrupt INTTC6 (DMA6) ITC6M2 ITC6M1 ITC6M0 R/W 0 0 0 Level of request interrupt IR2LE IR1LE W IR0LE
INTETC23
INTTC2& INTTC3 enable
00F2H
ITC3C R 0 1: INTTC3
INTETC45
INTTC4& INTTC5 enable
00F3H
ITC5C R 0 1: INTTC5
INTETC67
INTTC6& INTTC7 enable
00F4H
ITC7C R 0 1: INTTC7
SIMC
SIO interrupt mode control
00F5H (Prohibit RMW)
1 1 1 0: INTRX2 0: INTRX1 0: INTRX0 edge edge edge mode mode mode 1: INTRX2 1: INTRX1 1: INTRX0 level level level mode mode mode I3EDGE I2EDGE W I1EDGE I0EDGE I0LE R/W 0 Always write "0". -
IIMC
Interrupt input mode control
00F6H (Prohibit RMW)
INTWDT
INTWD
00F7H
- - - CLRV7 0
0 0 0 0 0 INT3EDGE INT2EDGE INT1EDGE INT0EDGE 0: INT0 edge mode 0: Rising 0: Rising 0: Rising 0: Rising 1: Falling 1: Falling 1: Falling 1: Falling 1: INT0 l level mode - INTWD - - - ITCWD - - - R - - - - 0 - - Always write "0". 1: INTWD - CLRV6 0 CLRV5 0 CLRV4 W CLRV3 CLRV2 0 CLRV1 0
- - CLRV0 0
INTCLR
Interrupt clear control
00F8H (Prohibit RMW)
0 0 Interrupt vector
92C820-348
2007-02-16
TMP92C820
(4) DMA controller Symbol
DMA0V
Name
DMA0 start vector DMA1 start vector
Address
0100H
7
6
5
DMA0V5 0 DMA1V5
4
DMA0V4 0 DMA1V4 0 DMA2V4 0 DMA3V4 0 DMA4V4 0 DMA5V4 0 DMA6V4 0 DMA7V4 0 DBST4 R/W 0
3
2
1
DMA0V1 0 DMA1V1 0 DMA2V1 0 DMA3V1 0 DMA4V1 0 DMA5V1 0 DMA6V1 0 DMA7V1 0 DBST1 0 DREQ1 0
0
DMA0V0 0 DMA1V0 0 DMA2V0 0 DMA3V0 0 DMA4V0 0 DMA5V0 0 DMA6V0 0 DMA7V0 0 DBST0 0 DREQ0 0
DMA0V3 DMA0V2 R/W 0 0 DMA0 start vector DMA1V3 DMA1V2 R/W
DMA1V
0101H
0 DMA2V5
0 0 DMA1 start vector DMA2V3 DMA2V2 R/W
DMA2V
DMA2 start vector DMA3 start vector DMA4 start vector
0102H
0 DMA3V5
0 0 DMA2 start vector DMA3V3 DMA3V2 R/W 0 0 DMA3 start vector DMA4V3 DMA4V2 R/W
DMA3V
0103H
0 DMA4V5
DMA4V
0104H
0 DMA5V5
0 0 DMA4 start vector DMA5V3 DMA5V2 R/W 0 0 DMA5 start vector DMA6V3 DMA6V2 R/W 0 0 DMA6 start vector DMA7V3 0 DBST3 0 DMA7V2 0 DBST2 0 R/W
DMA5V
DMA5 start vector DMA6 start vector
0105H
0 DMA6V5
DMA6V
0106H
0 DMA7V5
DMA7V
DMA7 start vector
0107H
0 DBST7 DBST6 0 DREQ6 0 DBST5 0 DREQ5 0
DMA7 start vector DMA burst
DMAB
0108H
0 DREQ7 0
1: DMA request on burst mode DMA request 0109H (Prohibit RMW) DREQ4 DREQ3 DREQ2 R/W 0 0 0 1: DMA request in software
DMAR
92C820-349
2007-02-16
TMP92C820
(5) Memory controller (1/3) Symbol Name Address 7 6
B0WW2
5
B0WW1 W 1
4
B0WW0
3
2
B0WR2
1
B0WR1 W 1
0
B0WR0
B0CSL
BLOCK0 MEMC control register low
0140H (Prohibit RMW)
0 0 Write waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B0REC 0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
0 0 Read waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B0OM1 0 01: Reserved 10: Reserved 11: Reserved B1WR2 B0OM0 W 0 B0BUS1 B0BUS0
B0CSH
BLOCK0 MEMCT control register high
B0E W 0 0141H CS select (Prohibit 0: Disable RMW) 1: enable
00: ROM/SRAM
0 0 Data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: Reserved B1WR1 B1WR0 W 1 0
B1WW2
B1CSL
BLOCK1 MEMC control register low
0144H (Prohibit RMW)
0 0 Write waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B1REC 0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
B1WW1 W 1
B1WW0
0 Read waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B1OM1 0 01: Reserved 10: Reserved 11: SDRAM B2WR2 B1OM0 W 0 B1BUS1
B1CSH
BLOCK1 MEMC control register high
B1E W 0 0145H CS select (Prohibit 0: Disable RMW) 1: Enable
B1BUS0
00: ROM/SRAM
0 0 Data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: Reserved B2WR1 B2WR0 W 1 0
B2WW2
B2CSL
BLOCK2 MEMC control register low
0148H (Prohibit RMW)
0 0 Write waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B2E W B2M B2REC 0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
B2WW1 W 1
B2WW0
0 Read waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B2OM1 0 01: Reserved 10: Reserved 11: Reserved B2OM0 W 0 B2BUS1
B2BUS0
B2CSH
BLOCK2 MEMC control register high
1 0 CS select 0: 16 Mbytes 1: Sets area (Prohibit 0: Disable 1: Enable RMW) 0149H
00: ROM/SRAM
0/1 0/1 Data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: Reserved
92C820-350
2007-02-16
TMP92C820
Memory controller (2/3) Symbol Name Address 7 6
B3WW2
5
B3WW1 W 1
4
B3WW0
3
2
B3WR2
1
B3WR1 W 1
0
B3WR0
B3CSL
BLOCK3 MEMC control register low
014CH (Prohibit RMW)
0 0 Write waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B3REC 0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
0 0 Read waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) B3OM1 0 01: Reserved 10: Reserved 11: Reserved BEXWR2 B3OM0 W 0 B3BUS1 B3BUS0
B3CSH
BLOCK3 MEMC control register high
B3E W 0 014DH CS select (Prohibit 0: Disable RMW) 1: Enable
00: ROM/SRAM
0 0 Data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: Reserved BEXWR1 BEXWR0 W 1 0
BEXCSL
BLOCK EX MEMC control register low
0158H Prohibit RMW
BEXWW2 BEXWW1 BEXWW0 W 0 1 0 Write waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) BEXOM1
0 Read waits 001: 2 states (0 waits) 010: 3 states (1 wait) 101: 4 states (2 waits) 110: 5 states (3 waits) 111: 6 states (4 waits) 011: WAIT pin input mode Others: (Reserved) BEXOM0 W 0
BEXBUS1
BEXBUS0
BEXCSH
BLOCK EX MEMC control register high
0159H (Prohibit RMW)
0 00: ROM/SRAM 01: Reserved 10: Reserved 11: Reserved OPGE OPWR1
0 0 Data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: Reserved PR1 PR0 1 0
PMEMCR
Page ROM control register
0166H
0 0 ROM Wait number on page page 00: 1 state access (n-1-1-1 mode) 0: Disable 01: 2 states 1: Enable (n-2-2-2 mode) 10: 3 states (n-3-3-3 mode) 11: (Reserved)
OPWR0 R/W 0
Byte number in a page 00: 64 bytes 01: 32 bytes 10: 16 bytes (Default) 11: 8 bytes
92C820-351
2007-02-16
TMP92C820
Memory control (3/3) Symbol
MAMR0
Name
Memory register 0 Memory start address register 0 Memory address mask register 1 Memory start address register 1 Memory register 2 Memory start address register 2 Memory register 3 Memory start address register 3
Address
0142H
7
M0V20 1 M0S23
6
M0V19 1 M0S22 1 M1V20 1 M1S22 1 M2V21 1 M2S22 1 M3V21 1 M3S22 1
5
M0V18
4
M0V17
3
M0V16
2
M0V15
1
M0V14-9 1 M0S17 1 MV15-9 1 M1S17 1 M2V16 1 M2S17 1 M3V16 1 M3S17 1
0
M0V8 1 M0S16 1 M1V8 1 M1S16 1 M2V15 1 M2S16 1 M3V15 1 M3S16 1
R/W 1 1 1 1 0: Compare enable 1: Compare disable M0S21 1 M0S20 R/W M0S19 M0S18 1 M1V16
MSAR0
0143H
1 M1V21
1 1 Set start address A23 to A16 M1V18 R/W M1V17
M1V19
MAMR1
0146H
1 M1S23
1 1 1 1 0: Compare enable 1: Compare disable M1S21 1 M1S20 R/W M1S19 M1S18 1 M2V17
MSAR1
0147H
1 M2V22
1 1 Set start address A23 to A16 M2V19 R/W M2V18
M2V20
MAMR2
014AH
1 M2S23
1 1 1 1 0: Compare enable 1: Compare disable M2S21 1 M2S20 R/W M2S19 M2S18 1 M3V17
MSAR2
014BH
1 M3V22
1 1 Set start address A23 to A16 M3V19 R/W M3V18
M3V20
MAMR3
014EH
1 M3S23
1 1 1 1 0: Compare enable 1: Compare disable M3S21 1 M3S20 R/W M3S19 M3S18 1
MSAR3
014FH
1
1 1 Set start address A23 to A16
92C820-352
2007-02-16
TMP92C820
(6) MMU Symbol Name Address 7
L0E R/W 0 Use BANK for LOCAL0 0: Not use 1: Use L1E R/W 0 Use BANK for LOCAL1 0: Not use 1: Use L2E R/W 0 Use BANK for LOCAL2 0: Disable 1: Enable L3E R/W 0 Use BANK for LOCAL3 0: Disable 1: Enable
6
5
4
3
2
L0EA22
1
0
LOCAL0
LOCAL0 register
01D0H
L0EA21 L0EA20 R/W 0 0 0 Setting BANK number for LOCAL0
L1EA23
LOCAL1
LOCAL1 register
01D1H
L1EA22 L1EA21 R/W 0 0 0 Setting BANK number for LOCAL1
L2EA23
LOCAL2
LOCAL2 register
01D2H
L2EA22 L2EA21 R/W 0 0 0 Setting BANK number for LOCAL2
L3EA26
L3EA25
LOCAL3
LOCAL3 register
01D3H
0 0 00000 to 00011: CS2B 00100 to 00111: CS2C 01000 to 01011: CS2D
L3EA24 L3EA23 L3EA22 R/W 0 0 0 01100 to 01111: CS2E 10000 to 10011: CS2F 10100 to 10111: CS2G 11000 to 11111: Set prohibition
92C820-353
2007-02-16
TMP92C820
(7) Clock gear (1/2) Symbol Name Address 7
XEN R/W 1 System clock control register 0 1
HighLowfrequency frequency oscillator oscillator (fc) (fs) 0: Stop 0: Stop 1: Oscillation 1: Oscillation
6
XTEN
5
4
3
2
WUEF R/W 0
Warm-up timer 0: Write Don't care 1: Write start timer 0: Read end warm up 1: Read do not end warm up
1
0
SYSCR0
10E0H
SYSCK 0 Select system clock 0: fc 1: fs
SYSCR1
System clock control register 1
10E1H
GEAR2 GEAR1 GEAR0 R/W 1 0 0 Select gear value of high frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved) DRVE 0 Pin state control in STOP/ IDLE1 mode 0: I/O off 1: Remains the state before halt
SYSCR2
System clock control register 2
- R/W 0 Always write "0". 10E2H
WUPTM1 WUPTM0 1 0 Warm-up timer 00: Reserved 8 01: 2 /inputted frequency 14 10: 2 /inputted frequency 16 11: 2 /inputted frequency
HALTM1 HALTM0 SELDRV R/W 1 1 0 HALT mode 00: Reserved mode select 01: STOP mode 0: Stop 10: IDLE1 mode 1: IDLE1 11: IDLE2 mode
92C820-354
2007-02-16
TMP92C820
Clock gear (2/2) Symbol Name Address 7
PROTECT
6
5
4
3
2
EXTIN
1
DRVOSCH
0
DRVOSCL
EMCCR0
EMC control register 0
10E3H
R 0 Protect flag 0: OFF 1: ON
R/W 0 1 1: External fc clock oscillator driver ability 1: Normal 0: Weak
1 fs oscillator driver ability 1: Normal 0: Weak
EMCCR1
EMC control register 1 EMC control register 2
10E4H Switching the protect ON/OFF by write to following 1st-Key, 2nd-Key 1st-Key: EMCCR1 = 5AH, EMCCR2 = A5H in succession write 2nd-Key: EMCCR1 = A5H, EMCCR2 = 5AH in succession write 10E5H
EMCCR2
92C820-355
2007-02-16
TMP92C820
(8) LCD controller (1/6) Symbol Name Address 7
BAE
6
AAE
5
SCPW1
4
3
2
BULK 0 Bytenumber/ common 0: 512 bytes 1: 1024 bytes FMN2 0 SEG2 0
1
RAMTYPE
0
MODE 0 Mode selection 0: RAM 1: SR
LCDMODE
LCD mode register
0200H
0 0 Used by Used by B area A area 0: Disable 0: Disable 1: Enable 1: Enable
SCPW0 TA3LCDCK R/W 1 0 0 SCP width Select low frequency 00: BaseSCP 0: fs 01: 2 clocks (32 kHz) 10: 4 clocks 1: TA3OUT 11: 8 clocks FMN5 0 COM1 FMN4 R/W 0 COM0 R/W FMN3 0 SEG3 0
0 Display RAM selection 0: SRAM 1: SDRAM
LCDDVM
Divide FRM register
FMN7 0201H 0 COM3
FMN6 0 COM2
FMN1 0 SEG1 0
FMN0 0 SEG0 0
Setting DVM bit7 to 0
LCDSIZE
LCD size register
0202H
0 0 0 0 Setting the LCD common number for SR mode 000: 128 0101: 400 0001: 160 0110: 480 0010: 200 0011: 240 0100: 320 Others: Reserved LCDON 0
DOFF
Setting the LCD segment number for SR mode 0000: 128 0101: 480 0001: 160 0110: 560 0010: 240 0111: 640 0011: 320 0100: 400 Others: Reserved FP9 MMULCD FP8 START
ALL0 0 LD bus output control
0: OFF (= Normal) 1: ON (= ALL 0)
FRMON
- R/W
LCDCTL
LCD control register
0203H
port 0: OFF 1: ON
0 0 Divided FR Always mode write "0". 0: Disable 1: Enable
0 0 Setting bit Type 9 for fFP selection [9:0] of LCD
driver with built-in RAM 0: Sequential access 1:Random access
0 0 Setting bit Start 8 for fFP control in [9:0] SR mode 0: Stop 1: Start
LCDFFP
LCD frequency register
FP7 0204H 0
FP6 0
FP5 0
FP4 R/W
FP3
FP2 0
FP1 0
FP0 0
0 0 fFP set value bit7 to 0
LCDGL
LCD gray level register
GRAY1 GRAY0 R/W 0 0 0205H 00: Monochrome 01: 4 levels 10: 8 levels 11: 16 levels
92C820-356
2007-02-16
TMP92C820
LCD controller (2/6) Symbol Name Address 7
CDE R/W LCDCM LCD cursor mode register 0206H 0 Cursor 0: OFF 1: ON 0 Cursor color 0: White 1: Black
6
CCS
5
4
3
2
1
CBE1
0
CBE0
R/W 0 0 Cursor blink interval 00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz CW4 CW3 CW2 CW1 R/W 0 0 0 Cursor width (X size) 00000: 1 dot (Min) 11111: 32 dots (Max) CH2 CH1 R/W 0 0 0 Cursor height (Y size) 00000: 1 dot (Min) 11111: 32 dots (Max) APB2 R/W 0 0 0 0 Setting bit3 to 0 for cursor absolute position APB1 CW0 0
LCDCW
LCD cursor width register
0207H
0
CH4 LCD cursor height register LCD cursor APB register
LCD cursor AP register low LCD cursor
CH3
CH0 0
LCDCH
0208H
0
APB3 0209H
APB0
LCDCP
CAP7 020AH 0 CAP15 020BH 0
CAP6 0 CAP14 0
CAP5
CAP4 R/W
CAP3
CAP2
CAP1 0 CAP9 0
CAP0 0 CAP8 0
LCDCPL
0 0 0 0 Setting bit7 to 0 for cursor absolute position CAP13 0 CAP12 R/W 0 0 0 CAP11 CAP10
LCDCPM
AP register medium LCD
Setting bit15 to 8 for cursor absolute position CAP23 020CH 0 CAP22 1 CAP21 CAP20 R/W 0 0 0 0 Setting bit23 to 16 for cursor absolute position 0 0 CAP19 CAP18 CAP17 CAP16
LCDCPH
cursor AP register high
92C820-357
2007-02-16
TMP92C820
LCD controller (3/6) Symbol Name
A area start
Address
7
SA15
6
SA14
5
SA13
4
SA12 R/W
3
SA11
2
SA10
1
SA9
0
SA8
LSARAM
address register medium A area start
0210H 0 0 0 0
0
0
0
0
Setting start address A15 to A8 for the source data memory in A area SA23 0211H 0 1 0 0 SA22 SA21 SA20 R/W 0 0 0 0 SA19 SA18 SA17 SA16
LSARAH
address register high A area end
Setting start address A23 to A16 for the source data memory in A area EA15 0212H 0 0 0 0 EA14 EA13 EA12 R/W 0 0 0 0 EA11 EA10 EA9 EA8
LEARAM
address register medium A area end
Setting end address A15 to A8 for the source data memory in A area EA23 0213H 0 1 0 0 EA22 EA21 EA20 R/W 0 0 0 0 EA19 EA18 EA17 EA16
LEARAH
address register high B area start
Setting end address A23 to A16 for the source data memory in A area SA15 0214H 0 0 0 0 SA14 SA13 SA12 R/W 0 0 0 0 SA11 SA10 SA9 SA8
LSARBM
address register medium B area start
Setting start address A15 to A8 for the source data memory in B area SA23 0215H 0 1 0 0 SA22 SA21 SA20 R/W 0 0 0 0 SA19 SA18 SA17 SA16
LSARBH
address register high B area end
Setting start address A23 to A16 for the source data memory in B area EA15 0216H 0 0 0 0 EA14 EA13 EA12 R/W 0 0 0 0 EA11 EA10 EA9 EA8
LEARBM
address register medium B area end
Setting end address A15 to A8 for the source data memory in B area EA23 0217H 0 1 0 0 EA22 EA21 EA20 R/W 0 0 0 0 EA19 EA18 EA17 EA16
LEARBH
address register high C area start
Setting end address A23 to A16 for the source data memory in B area SA7 0218H 0 0 0 0 SA6 SA5 SA4 R/W 0 0 0 0 SA3 SA2 SA1 SA0
LSARCL
address register low C area start
Setting start address A7 to A0 for the source data memory in C area SA15 0219H 0 0 0 0 SA14 SA13 SA12 R/W 0 0 0 0 SA11 SA10 SA9 SA8
LSARCM
address register medium C area start
Setting start address A15 to A8 for the source data memory in C area SA23 021AH 0 1 0 0 SA22 SA21 SA20 R/W 0 0 0 0 SA19 SA18 SA17 SA16
LSARCH
address register high
Setting start address A23 to A16 for the source data memory in C area
92C820-358
2007-02-16
TMP92C820
LCD controller (4/6) Symbol
LG0L
Name
LCD gray level data setting register low LCD gray
Address
0220H
7
- 0 -
6
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
5
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
4
- R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 0
3
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1
2
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
1
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1
0
- 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
LG0H
level data setting register high LCD gray level data setting register low LCD gray level data setting register high LCD gray level data setting register low LCD gray level data setting register high
0221H
0 -
LG1L
0222H
0 -
LG1H
0223H
1 -
LG2L
0224H
1 -
LG2H
0225H
1 -
LCD gray
LG3L
level data setting register low
0226H
1 -
LG3H
LCD gray level data setting register high LCD gray level data setting register low LCD gray
0227H
1 -
LG4L
0228H
1 -
LG4H
level data setting register high LCD gray
0229H
1 -
LG5L
level data setting register low LCD gray level data setting register high LCD gray level data setting register low LCD gray level data setting register high
022AH
1 -
LG5H
022BH
1 -
LG6L
022CH
1 -
LG6H
022DH
1
92C820-359
2007-02-16
TMP92C820
LCD controller (5/6) Symbol
LG7L
Name
LCD gray level data setting register low LCD gray
Address
022EH
7
- 1 -
6
- 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1
5
- 1 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1
4
- R/W 0 - R/W 0 - R/W 0 - R/W 0 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1 - R/W 1
3
- 1 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 1
2
- 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1
1
- 1 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0
0
- 0 - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1
LG7H
level data setting register high LCD gray
022FH
1 -
LG8L
level data setting register low LCD gray
0230H
1 -
LG8H
level data setting register high LCD gray
0231H
1 -
LG9L
level data setting register low LCD gray
0232H
0 -
LG9H
level data setting register high LCD gray
0233H
1 -
LGAL
level data setting register low LCD gray
0234H
1 -
LGAH
level data setting register high LCD gray
0235H
1 -
LGBL
level data setting register low LCD gray
0236H
1 -
LGBH
level data setting register high LCD gray
0237H
1 -
LGCL
level data setting register low LCD gray
0238H
1 -
LGCH
level data setting register high LCD gray
0239H
1 -
LGDL
level data setting register low LCD gray
023AH
1 -
LGDH
level data setting register high
023BH
1
92C820-360
2007-02-16
TMP92C820
LCD controller (6/6) Symbol Name
LCD gray level
Address
7
-
6
- 1
5
- 0
4
- R/W 1
3
- 1
2
- 1
1
- 0
0
- 1
LGEL
data setting register low LCD gray level
023CH
1
- 023DH 1
- 1
- 0
- R/W 1
- 1
- 1
- 0
- 1
LGEH
data setting register high LCD gray level
- 023EH 1
- 1
- 1
- R/W 1
- 1
- 1
- 1
- 1
LGFL
data setting register low LCD gray level
- 023FH 1
- 1
- 1
- R/W 1
- 1
- 1
- 1
- 1
LGFH
data setting register high
92C820-361
2007-02-16
TMP92C820
(9) SDRAM controller Symbol Name Address 7
SDINI R/W 0 Auto initialize 0: Disable 1: Enable
6
5
4
3
2
1
0
SDACR
SDRAM address control
0250H
SDBUS1 SDBU0 R/W 0 0 Selecting structure of data bus 00: 16 bits x 1 01: 16 bits x 2 10: 32 bits x 1
SMUXW1 SMUXW0 SMAC R/W 0 0 0 Selecting address SDRAM multiplex type controller 0: Disable 00: Type A 1: Enable 01: Type B 10: Type C 11: Reserved
SDRCR
SDRAM refresh control
0251H
SRS1 R/W 0 0 0 Self refresh Refresh interval 0: Disable 000: 78 states 1: Enable 100: 195 states 001: 97 states 101: 210 states 010: 124 states 110: 249 states 011: 156 states 111: 312 states
SFRC
SRS2
SRS0 0
SASFRC 0 Auto/self refresh 0: Disable 1: Enable
SRC R/W 0 Interval refresh 0: Disable 1: Enable
92C820-362
2007-02-16
TMP92C820
(10) 8-bit timer Symbol Name Address 7
TA0RDE R/W 0 Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA01
2
TA01PRUN
1
TA1RUN R/W 0
0
TA0RUN
TA01RUN
TMRA01 RUN register
1100H
0 0 0 IDLE2 TMRA01 Up counter Up counter 0: Stop Prescaler (UC1) (UC0) 1: Operate 0: Stop and clear 1: Run (Count up) - W Undefined - W Undefined
TA0REG
8-bit timer register 0 8-bit timer register 1
1102H Prohibit RMW 1103H Prohibit RMW TA01M1 0 TA01M0 0 PWM01
TA1REG
TMRA01 TA01MOD mode register
Operation mode
1104H
00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
TA1FFCR
TMRA1 flip-flop control register
1105H Prohibit RMW
PWM00 TA1CLK1 TA1CLK0 R/W 0 0 0 0 Source clock for PWM cycle TMRA1 00: Reserved 6 00: TA0TRG 01: 2 7 01: T1 10: 2 8 10: T16 11: 2 11: T256 TA1FFC1 TA1FFC0 W 1 1 00: Invert TA1FF 01: Set TA1FF 10: Clear TA1FF 11: Don't care
TA0CLK1 TA0CLK0 0 0 Source clock for TMRA0 00: TA0IN pin 01: T1 10: T4 11: T16 TA1FFIE TA1FFIS R/W 0 0
TA1FF Control for inversion 0: Disable 1: Enable TA1FF Inversion select 0: TMRA0 1: TMRA1
TA23RUN
TMRA23 RUN register
1108H
TA2RDE R/W 0 Double buffer 0: Disable 1: Enable
I2TA23
TA23PRUN
0 0 0 TMRA23 Up counter Up counter IDLE2 0: Stop Prescaler (UC3) (UC2) 1: Operate 0: Stop and clear 1: Run (Count up) - W Undefined - W Undefined
TA3RUN R/W 0
TA2RUN
TA2REG
8-bit timer register 2 8-bit timer register 3
110AH Prohibit RMW 110BH Prohibit RMW TA23M1 0 110CH
Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
TA3REG
TA23M0 0
TMRA23 TA23MOD mode register
TA3FFCR
TMRA3 flip-flop control register
110DH Prohibit RMW
PWM20 TA3CLK1 TA3CLK0 R/W 0 0 0 0 PWM cycle Source clock for TMRA1 00: Reserved 6 00: TA2TRG 01: 2 7 01: T1 10: 2 8 10: T16 11: 2 11: T256 TA3FFC1 TA3FFC0 W 1 1 00: Invert TA3FF 01: Set TA3FF 10: Clear TA3FF 11: Don't care
PWM21
TA2CLK1 TA2CLK0 0 0 Source clock for TMRA2 00: Reserved 01: T1 10: T4 11: T16 TA3FFIE TA3FFIS R/W 0 0
TA3FF Control for inversion 0: Disable 1: Enable TA3FF Inversion select 0: TMRA2 1: TMRA3
92C820-363
2007-02-16
TMP92C820
(11) 16-bit timer Symbol Name Address 7 6 5 4 3
I2TB0 0
IDLE2 0: Stop
2
TB0PRUN R/W 0 TMRB0 prescaler
1
0
TB0RUN R/W 0 Up counter (UC10)
TB0RUN
TMRB0 RUN register
1180H
TB0RDE - R/W 0 0 Double Always buffer write "0". 0: Disable 1: Enable - R/W - TB0CP0I W 1
Execute software capture 0: Software capture 1: Undefined
1: Operate
0: Stop and clear 1: Run (Count up) TB0CPM1 TB0CPM0 0 0 Capture timing 00: Disable 01: Reserved 10: Reserved 11: TA1OUT TA1OUT TB0CLE R/W 0 Control up counter 0: Disable clearing 1: Enable clearing TB0CLK1 TB0CLK0 0 0 TMRB0 source clock 00: Reserved 01: T1 10: T4 11: T16
TB0MOD
TMRB0 mode register
1182H Prohibit RMW
0 0 Always write "0".
- W
-
TB0FFCR
TMRB0 flip-flop control register
1 1 Always write "11". 1183H Prohibit RMW
TB0E0T1 TB0FF0C1 TB0FF0C0 W* 0 1 1 Control TB0FF0 00: Invert 01: Set Invert when Invert when Invert when Invert when 10: Clear 11: Don't care the UC10 the UC10 the UC10 the UC10 * Always read as 11. value value is value is value
loaded in to loaded in to matches the matches the value in TB0CP1H/L. TB0CP0H/L. value in TB0RG1H/L. TB0RG0H/L.
TB0C0T1 TB0E1T1 R/W 0 0 0 TB0FF0 inversion trigger 0: Disable trigger 1: Enable trigger
TB0C1T1
TB0RG0L
16-bit timer register 0 low 16-bit timer register 0 high 16-bit timer register 1 low 16-bit timer register 1 high Capture register 0 low Capture register 0 high Capture register 1 low Capture register 1 high
1188H Prohibit RMW 1189H Prohibit RMW 118AH Prohibit RMW 118BH Prohibit RMW 118CH
- W Undefined - W Undefined - W Undefined - W Undefined - R Undefined - R Undefined - R Undefined - R Undefined
TB0RG0H
TB0RG1L
TB0RG1H
TB0CP0L
TB0CP0H
118DH
TB0CP1L
118EH
TB0CP1H
118FH
92C820-364
2007-02-16
TMP92C820
(12) UART/serial channel (1/3) Symbol
SC0BUF
Name
Serial channel 0 buffer register
Address
1200H Prohibit RMW
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R (Receiving)/W (Transmission) Undefined PE R/W 0 Parity 0: Disable 1: Enable RXE OERR PERR FERR R (Clear to 0 after reading) 0 0 0 1: Error Overrun Parity Framing WU R/W SM1 SM0
Serial
RB8 R 1201H
Undefined
EVEN 0 Parity 0: Odd 1: Even CTSE 0 0: CTS disable 1: CTS enable
SCLKS R/W
IOC
SC0CR
channel 0 control register
Receive data bit8 TB8
0 0 0: SCLK0 0: Baud rate generator 1: SCLK0
1: SCLK0 pin input
SC1
SC0
Serial
SC0MOD0
channel 0 mode 0 register
1202H
0 Transmission data bit8
0 0 0: Receive Wakeup disable 0: Disable 1: Receive 1: Enable enable
-
Serial channel 0
BR0ADDE 0 (16 - K)/16 divided 0: Disable 1: Enable
BR0CK1 0 00: T0 01: T2 10: T8 11: T32
BR0CR
baud rate control register
1203H
0 Always write "0".
0 0 0 0 00: I/O interface mode 00: TA0TRG 01: 7-bit UART mode 01: Baud rate 10: 8-bit UART mode generator 11: 9-bit UART mode 10: Internal clock fIO 11: External clock (SCLK0 input) BR0CK0 BR0S3 BR0S2 BR0S1 BR0S0 R/W 0 0 0 0 0 Divided frequency setting
Serial
BR0K3 1204H 0
BR0K2 R/W
BR0K1
BR0K0 0
BR0ADD
channel 0 K setting register
0 0 Sets frequency divisor "K" (divided by N + (16 - K)/16).
Serial
SC0MOD1
channel 0 mode 1 register
1205H
I2S0 FDPX0 R/W R/W 0 0 IDLE2 Duplex 0: Stop 1: Full 1: Operate duplex 0: Half duplex PLSEL RXSEL 0 Select transmit pulse width 0: 3/16 1: 1/16
IrDA
SIRCR
control register
1207H
SIRWD3 SIRWD2 SIRWD1 SIRWD0 R/W 0 0 0 0 0 0 0 Receive Transmit Receive Select receive pulse width 0: Disable 0: Disable Set effective pulse width for equal or more data 0: "H" pulse 1: Enable 1: Enable than 2x x (Value + 1) + 100ns 1: "L" pulse Can be set: 1 to 14 Can not be set: 0 and 15
TXEN
RXEN
92C820-365
2007-02-16
TMP92C820
UART/serial channel (2/3) Symbol
SC1BUF
Name
Serial channel 1 buffer register
Address
1208H Prohibit RMW
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R (Receiving)/W (Transmission) Undefined PE R/W 0 Parity 0: Disable 1: Enable RXE OERR 0 Overrun WU R/W PERR 0 1: Error Parity SM1 Framing SM0 FERR 0 R (Clear to 0 after reading)
RB8
Serial
EVEN 0 Parity 0: Odd 1: Even CTSE 0 0: CTS disable 1: CTS enable
SCLKS R/W
IOC
R 1209H
Undefined
SC1CR
channel 1 control register
Receive data bit8 TB8
0 0 0: SCLK1 0: Baud rate generator 1: SCLK1
1: SCLK1 pin input
SC1
SC0
Serial
SC1MOD0
channel 1 mode 0 register
120AH
0 Transmission data bit8
0 0 0: Receive Wakeup disable 0: Disable 1: Receive 1: Enable enable
00: 01: 10: 11:
-
Serial channel 1
BR1ADDE BR1CK1 0
(16 - K)/16 divided
BR1CR
baud rate control register
120BH
0 Always write "0".
0: Disable 1: Enable
0 00: T0 01: T2 10: T8 11: T32
BR1CK0 R/W 0
0 0 0 0 I/O interface mode 00: TA0TRG 7-bit UART mode 01: Baud rate 8-bit UART mode generator 9-bit UART mode 10: Internal clock fIO 11: External clock (SCLK1 input) BR1S3 BR1S2 BR1S1 BR1S0 0 0 0 Divided frequency setting 0
Serial
BR1K3 120CH 0
BR1K2 R/W
BR1K1
BR1K0 0
BR1ADD
channel 1 K setting register
0 0 Sets frequency divisor "K" (divided by N + (16 - K)/16)
I2S1 R/W
Serial
FDPX1
SC1MOD1
channel 1 mode 1 register
120DH
0 0 IDLE2 Duplex 0: Stop 1: Full 1: Operate duplex 0: Half duplex
92C820-366
2007-02-16
TMP92C820
UART/serial channel (3/3) Symbol
SC2BUF
Name
Serial channel 2 buffer register
Address
1210H Prohibit RMW
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R (Receiving)/W (Transmission) Undefined PE R/W 0 Parity 0: Disable 1: Enable RXE OERR PERR FERR R (Clear to 0 after reading) 0 0 0 1:Error Overrun WU R/W Parity SM1 Framing SM0
Serial
RB8 R 1211H
Undefined
EVEN 0 Parity 0: Odd 1: Even - 0 Always write "0".
- R/W 0 Always write "0". SC1
- 0 Always write "0". SC0
SC2CR
channel 2 control register
Receive data bit8 TB8
Serial
SC2MOD0
channel 2 mode 0 register
1212H
0 Transmission data bit8
0 0 0: Receive Wakeup disable 0: Disable 1: Receive 1: Enable enable
-
Serial channel 2
BR2ADDE BR2CK1 0
(16 - K)/16 divided
BR2CR
baud rate control register
1213H
0 Always write "0".
0: Disable 1: Enable
0 00: T0 01: T2 10: T8 11: T32
0 0 0 0 00: I/O interface mode 00: TA0REG 01: 7-bit UART mode 01: Baud rate 10: 8-bit UART mode generator 11: 9-bit UART mode 10: Internal clock fIO 11: Reserved BR2CK0 BR2S3 BR2S2 BR2S1 BR2S0 R/W 0 0 0 0 0 Divided frequency setting
Serial
BR2K3 1214H 0
BR2K2 R/W
BR2K1
BR2K0 0
BR2ADD
channel 2 K setting register
0 0 Sets frequency divisor "K" (divided by N + (16 - K)/16)
I2S2
Serial
FDPX2 R/W
SC2MOD1
channel 2 mode 1 register
1215H
0 0 Duplex IDLE2 1: Full 0: Stop duplex 1: Operate 0: Half duplex
92C820-367
2007-02-16
TMP92C820
(13) I2C bus/serial channel (1/2) Symbol Name Address
IC mode 1240H (Prohibit RMW) SBI0CR1 SBI0 control register 1
2
7
BC2
6
BC1
5
BC0
4
ACK
3
2
SCK2 W
1
SCK1
0
SCK0/ SWRMON
W 0 0 Number of transfer bits 000: 8 001: 1 010: 2 100: 4 101: 5 110: 6
SIOS SIO 0 mode Transfer 1240H (Prohibit 0: Stop 1: Start RMW)
SIOINH W
R/W 0 0 Acknow 011: 3 -ledge 111: 7 mode 0: Disable 1: Enable SIOM1 SIOM0
R/W 0 0 0/1 Setting of the divide value "n" 000: 5 001: 6 010: 7 011: 8 100: 9 101: 10 110: 11 111: Reserved SCK0 SCK1 W 0 0 0 Setting of the divide value "n" 000: 4 001: 5 010: 6 011: 7 100: 8 101: 9 110: 10 111: External clock SCK0 SCK2 DB1 DB0
SBI0DBR
SBI0 buffer register
1241H (Prohibit RMW)
DB7
0 0 0 Transfer mode Transfer 0: Continue 00: 8 bits transmit 1: Abort 10: 8 bits transmit/receive 11: 8 bits receive DB6 DB5 DB4 DB3 DB2 R (Receiving)/W (Transmission) Undefined SA5 0 SA4 0 SA3 W 0 Setting slave address SA2 0 SA1 0
SA6 I CBUS0 Address register
2
SA0 0
ALS 0
Address recognition 0: Enable 1: Disable
I2C0AR
1242H (Prohibit RMW)
0
MST IC 0 mode 0: Slave 1243H 1: Master (Prohibit RMW)
SBI0
2
TRX
BB
PIN W 1 INTSBE0 interrupt 0: Request 1: Cancel
SBIM1
SBIM0
SWRST1
SWRST0
0 0 0: Receive Start/Stop 1: Transmit condition generation 0: Stop 1: Start
SBI0CR2
control register 2
0 0 Operation mode selection 00: Port mode 01: SIO mode 2 10: I C mode 11: Reserved SBIM1 SBIM0 0 0
0 0 Software reset generate write "10" and "01", then an internal reset signal is generated. - W 0 Always write "0". - 0 Always write "0".
SIO mode 1243H (Prohibit RMW)
MST IC 0 mode 0: Slave 1243H 1: Master (Prohibit RMW)
SBI0
2
TRX
BB
PIN R 1 INTSBE0 interrupt 0: Request 1: Cancel
Operation mode selection 00: Port mode 01: SIO mode 2 10: I C mode 11: Reserved AL AAS 0 Arbitration lost detection 1: Detect 0 Slave address match detection monitor 1: Detect SIOF SEF R 0 0 Shift status Transfer 0: Stopped status 0: Stopped 1: In progress 1: In progress
AD0 0 General call detection 1: Detect
LRB 0 Last receive bit monitor 0: 0 1: 1
0 0 0: Receive Bus status 1: Transmit monitor 0: Free 1: Busy
SBI0SR
status register
SIO mode 1243H (Prohibit RMW)
92C820-368
2007-02-16
TMP92C820
I2C bus/serial channel (2/2) Symbol Name Address
I C mode 1244H (Prohibit RMW)
2
7
- W 0 Always write "0".
6
I2SBI0 R/W 0 IDLE2 0: Stop 1: Operate - R/W 0 Always write "0". - W 0 Always write "0".
5
4
3
2
1
0
SBI0
SBI0BR0
baud rate register 0
- SBI mode W 1244H 0 (Prohibit Always RMW) write "0". P4EN
SBI0
1245H (Prohibit RMW)
SBI0BR1
baud rate register 1
0 Clock control 0: Stop 1: Operate
92C820-369
2007-02-16
TMP92C820
(14) AD converter Symbol Name Address 7
EOCF R 0 ADMOD0 AD mode control register 0 12B8H 0
AD AD conversion conversion end flag busy flag 1: End 1: Busy
6
ADBF
5
- 0 Always write "0".
4
- 0 Always write "0".
3
ITM0
2
REPET
1
SCAN
0
ADS
R/W 0 0 0 0 0: Every 1 Repeat Scan mode AD time 0: Fixed conversion mode channel 1: Every 4 0: Single start mode times 1: Start mode 1: Channel Always 1: Repeat scan mode read as mode
"0"
VREFON 0 AD mode control register 1
Ladder resistance 0: OFF 1: ON
I2AD
-
- R/W 0 Always write "0".
- 0 Always write "0".
ADCH2
ADCH1
ADCH0
ADMOD1
12B9H
0 0 Always IDLE2 0: Stop write "0". 1: Operate
0 0 0 Input channel 000: AN0 AN0 001: AN1 AN0 AN1 010: AN2 AN0 AN1 AN2 011: AN3 AN0 AN1 AN2 AN3 100: AN4 AN0 AN1 AN2 AN3 AN4 ADTRG R/W 0 AD external trigger start control 0: Disable 1: Enable
ADMOD2
AD mode control register 1
12BAH
AD result ADREG0L register 0 low AD result ADREG0H register 0 high AD result ADREG1L register 1 low AD result ADREG1H register 1 high AD result ADREG2L register 2 low AD result ADREG2H register 2 high AD result ADREG3L register 3 low AD result ADREG3H register 3 high AD result ADREG4L register 4 low AD result ADREG4H register 4 high
ADR01 12A0H
ADR00 R Undefined ADR08 ADR07 ADR06 ADR05 R Undefined ADR04 ADR03
ADR0RF R 0 ADR02
ADR09 12A1H ADR11 12A2H
ADR10 R Undefined ADR18 ADR17 ADR16 ADR15 R Undefined ADR14 ADR13
ADR1RF R 0 ADR12
ADR19 12A3H ADR21 12A4H
ADR20 R Undefined ADR28 ADR27 ADR26 ADR25 R Undefined ADR24 ADR23
ADR2RF R 0 ADR22
ADR29 12A5H ADR31 12A6H
ADR30 R Undefined ADR38 ADR37 ADR36 ADR35 R Undefined ADR34 ADR33
ADR3RF R 0 ADR32
ADR39 12A7H ADR21 12A8H
ADR20 R Undefined ADR28 ADR27 ADR26 ADR25 R Undefined ADR24 ADR23
ADR4RF R 0 ADR22
ADR29 12A9H
92C820-370
2007-02-16
TMP92C820
(15) Watchdog timer Symbol Name Address 7
WDTE 1 WDT control 1: Enable
6
5
4
3
- 0 Always write "0".
2
I2WDT
1
0
WDMOD
WDT mode register
1300H
WDTP1 WDTP0 R/W 0 0 WDT select detecting time 15 00: 2 /fIO 17 01: 2 /fIO 19 10: 2 /fIO 21 11: 2 /fIO
RESCR - R/W 0 0 0 1: Internally Always IDLE2 connects write "0". 0: Stop WDT out 1: Operate to the reset pin
WDCR
WDT control register
1301H Prohibit RMW
- W - B1H: WDT disable code 4EH: WDT clear code
92C820-371
2007-02-16
TMP92C820
(16) RTC (Real time clock) Symbol
SECR
Name
Second register
Address
7
6
SE6
5
SE5
4
SE4
3
SE3 R/W Undefined 8 sec MI3 R/W Undefined 8 min. HO3
2
SE2
1
SE1
0
SE0
1320H "0" is read. 40 sec MI6 20 sec MI5 10 sec MI4
4 sec MI2
2 sec MI1
1 sec MI0
MINR
Minute register
1321H "0" is read. 40 min. 20 min. HO5 10 min. HO4
4 min. HO2
2 min. HO1
1 min. HO0
HOURR
Hour register
1322H "0" is read. 20 hour (PM/AM) 10 hour
R/W Undefined 8 hour 4 hour WE2
2 hour WE1 R/W Undefined W1 DA1
1 hour WE0
DAYR
Day register
1323H "0" is read. DA5 DA4 DA3 W2 DA2 R/W Undefined 8 day 4 day MO3 MO2 R/W Undefined 4 month
W0 DA0
DATER
Date register
1324H "0" is read. 1325H
PAGE 0
20 day
10 day MO4
2 day MO1
1 day MO0
MONTHR
Month register
"0" is read.
10 month
8 month
2 month
PAGE 1
"0" is read.
YE7 1326H Year register
PAGE 0
YE6
YE5
80 year
40 year
YEARR
PAGE 1
1327H PAGER Page register Prohibit RMW
INTENA R/W 0 INTRTC 0:disable 1:enable DIS1HZ
2 year 1 year Leap year setting 00: Leap year "0" is read. 01: One year after 10: Tow year after 11: Three year after ADJUST ENATMR ENAALM PAGE W R/W R/W Undefined Undefined "0" is read. "0" is read. PAGE 0:Don't Clock Alarm care setting 0:disable 0:disable 1:Adjust 1:enable 1:enable RSTTMR RE3 W Undefined 1: Reset alarm RSTALM RE2 RE1 RE0
20 year
YE3 R/W Undefined 10 year 8 year
YE4
YE2
YE1
1 month 0: Indicator for 12 hours 1: Indicator for 24 hours YE0
4 year
DIS16HZ
1328H RESTR Reset register Prohibit RMW 1 Hz 0:disable 1:enable 16 Hz 0:disable 1:enable 1: Reset clock
Always write "0".
92C820-372
2007-02-16
TMP92C820
(17) Melody/alarm generator Symbol
ALM
Name
Alarmpattern register
Address
1330H
7
AL8 0 FC1 R/W
6
AL7 0 FC0
5
AL6 0 ALMINV R/W 0 Alarm frequency invert 1: Invert
4
AL5
3
AL4
2
AL3 0
1
AL2 0 - R/W 0
0
AL1 0 MELALM R/W 0 Output frequency 0: Alarm 1: Melody
R/W 0 0 Alarm pattern set - R/W 0
MELALMC
Melody/ Alarm control register
1331H
0 0 Free-run counter control 00: Hold 01: Restart 10: Clear 11: Clear & start ML7 ML6 0
- - R/W R/W 0 0 Always write "0".
MELFL
Melody frequency L-register
ML5 0
ML4 R/W
ML3
ML2
ML1 0 ML9 R/W
ML0 0 ML8
1332H
0 MELON R/W 0 Melody counter control 0: Stop & clear 1: Start
0 0 0 Melody frequency set (Low 8 bits ) ML11 ML10
MELFH
Melody frequency H-register
1333H
0 0 0 0 Melody frequency set (Upper 4 bits)
ALMINT
Alarm interrupt enable register
1334H
- R/W 0 Always write "0".
IALM4E 0
IALM3E 0
IALM2E R/W 0
IALM1E 0
IALM0E 0
INTALM4 to INTALM0 alarm interrupt enable
92C820-373
2007-02-16
TMP92C820
6.
Port Section Equivalent Circuit Diagram
Reading the circuit diagram Basically, the gate symbols written are the same as those used for the standard CMOS logic IC [74HCXX] series. The dedicated signal is described below. STOP: This signal becomes active "1" when the HALT mode setting register is set to the STOP mode and the CPU executes the HALT instruction. When the drive enable bit is set to "1", however, STOP remains at "0". The input protection resistance ranges from several tens of ohms to several hundreds of ohms.
D0 to D7, P1 (D8 to D15), P2 (D16 to D23), P3 (D24 to D31), P4 (A0 to A7), P5 (A8 to A15), P6 (A16 to A23), P76 and PL0 to PL7
VCC Output data Output enable STOP N-ch P-ch
Input data
I/O
Input enable
P90, P96, PC0, PC1, PC3, PC5, PC6, PF1, PF2, PF4, PF5
VCC Output data Output enable STOP N-ch P-ch
Input data
I/O
Input enable
92C820-374
2007-02-16
TMP92C820
P70 to P75, P80 to P87, PJ0 to PJ7, PK0 to PK4 and PK6
VCC Output data P-ch Output STOP N-ch
PA
VCC
Input data
Input
P91 (SO/SDA), P92 (SI/SCL), P93 and P94
VCC Output data P-ch
Open-drain output enable STOP Input data
N-ch
I/O
Input enable
P95 (TXD2), PF0, PF3
VCC Output data P-ch
Open-drain output enable STOP Input data
N-ch
I/O
Input enable
92C820-375
2007-02-16
TMP92C820
PG (AN0 to AN4)
Analog input channel select Analog input N-ch P-ch
Input
Input data
Input enable
RESET
VCC 100 k (Typ.) RESET Schmitt WDTOUT Reset enable Input
X1 and X2
Clock Oscillator X2
High-frequency oscillation enable
P-ch
N-ch
X1
XT1 and XT2
Clock Oscillator XT2
Low-frequency oscillation enable
P-ch
N-ch
XT1
92C820-376
2007-02-16
TMP92C820
VREFH and VREFL
VREF ON
P-ch
VREFH
String resistance
VREFL
SDCLK
VCC Internal reset VCC CLKOUT1 P-ch Output Output enable N-ch P-ch
BE
BE
Input
AM0 to AM1
Input data
Input
92C820-377
2007-02-16
TMP92C820
7.
7.1
Points to Note and Restrictions
Notation
(1) The notation for built-in/I/O registers is as follows register symbol Example: TA01RUN denotes bit TA0RUN of register TA01RUN. (2) Read-modify-write instructions (RMW) An instruction in which the CPU reads data from memory and writes the data to the same memory location in one instruction. Example 1: Example 2: * SET INC 3, (TA01RUN); Set bit3 of TA01RUN. 1, (100H); Increment the data at 100H.
Examples of read-modify-write instructions on the TLCS-900 Exchange instruction EX (mem), R
Arithmetic operations ADD (mem), R/# SUB (mem), R/# INC #3, (mem) Logic operations AND (mem), R/# XOR (mem), R/# Bit manipulation operations STCF #3/A, (mem) SET #3, (mem) TSET #3, (mem) Rotate and shift operations RLC (mem) RL (mem) SLA (mem) SLL (mem) RLD (mem) (3) fc, fs, fFPH, fSYS and one state The clock frequency input on ins X1 and 2 is called fOSCH. The clock selected by DFMCR0 is called fc. The clock selected by SYSCR1 is called fFPH. The clock frequency give by fFPH divided by 2 is called fSYS. One cycle of fSYS is referred to as one state. RRC RR SRA SRL (mem) (mem) (mem) (mem) RES #3, (mem) CHG #3, (mem) OR (mem), R/# ADC (mem), R/# SBC (mem), R/# DEC #3, (mem)
RRD (mem)
92C820-378
2007-02-16
TMP92C820
7.2
Points to Note
(1) AM0 and AM1 pins This pin is connected to the VCC or the VSS pin. Do not alter the level when the pin is active. (2) EMU0 and EMU1 Open pins. (3) Reserved address areas The TMP92C820 does not have any reserved areas. (4) Warm-up counter The warm-up counter operates when STOP mode is released, even if the system is using an external oscillator. As a result a time equivalent to the warm-up time elapses between input of the release request and output of the system clock. (5) Programmable pull-up resistance The programmable pull-up resistor can be turned ON/OFF by a program when the ports are set for use as input ports. When the ports are set for use as output ports, they cannot be turned ON/OFF by a program. The data registers (e.g., P5) are used to turn the pull-up/pull-down resistors ON/OFF. Consequently read-modify-write instructions are prohibited. (6) Watchdog timer The watchdog timer starts operation immediately after a reset is released. When the watchdog timer is not to be used, disable it. (7) AD converter The string resistor between the VREFH and VREFL pins can be cut by a program so as to reduce power consumption. When STOP mode is used, disable the resistor using the program before the HALT instruction is executed. (8) CPU (Micro DMA) Only the "LDC cr, r" and "LDC r, cr" instructions can be used to access the control registers in the CPU. (e.g., The transfer source address register (DMASn).) (9) Undefined SFR The value of an undefined bit in an SFR is undefined when read. (10) POP SR instruction Please execute the POP SR instruction during DI condition. (11) Releasing the HALT mode by requesting an interruption Usually, interrupts can release all halts status. However, the interrupts = (INT0 to INT3, INTKEY, INTRTC and INTALM0 to INTALM4) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 3 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, release halt status can be released without difficulty. The priority of this interrupt is compared with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
92C820-379
2007-02-16
TMP92C820
8.
Package Dimensions
P-LQFP144-1616-0.40C Unit: mm
Note:
Palladium plating
92C820-380
2007-02-16


▲Up To Search▲   

 
Price & Availability of TMP92C820FG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X